Question

Using format long g, verify the following trigonometric identities by evaluating the left- and right-hand sides independently

0 0
Add a comment Improve this question Transcribed image text
Answer #1

% Matlab script to verify trignometric identities by evaluating the
% left-hand and right-hand sides independently

format long g;
format compact;
% define the x and y values
x = 0.5;
y = sqrt(3)/2;
% a(i)
% compute LHS and RHS independently
LHS = asin(x) + asin(y);
RHS = asin((x*sqrt(1-y^2)) + (y*sqrt(1-x^2)));
% calculate the absolute difference between LHS and RHS
diff = abs(LHS - RHS);
% display the LHS, RHS and absolute difference
disp("LHS: ");
disp(LHS);
disp("RHS: ");
disp(RHS);
disp("Absolute difference: ");
disp(diff);

% a(ii)
LHS = asin(x) - asin(y);
RHS = asin((x*sqrt(1-y^2)) - (y*sqrt(1-x^2)));

diff = abs(LHS - RHS);
disp("LHS: ");
disp(LHS);
disp("RHS: ");
disp(RHS);
disp("Absolute difference: ");
disp(diff);

% b(i)
LHS = atan(x) + atan(y);
RHS = atan((x+y)/(1-(x*y)));
diff = abs(LHS-RHS);
disp("LHS: ");
disp(LHS);
disp("RHS: ");
disp(RHS);
disp("Absolute difference: ");
disp(diff);

% b(ii)
LHS = atan(x) - atan(y);
RHS = atan((x-y)/(1+(x*y)));
diff = abs(LHS-RHS);
disp("LHS: ");
disp(LHS);
disp("RHS: ");
disp(RHS);
disp("Absolute difference: ");
disp(diff);

%end of script

Output:

LHS: 1.5707963267949 RHS: 1.5707963267949 Absolute difference: 0 LHS: -0.523598775598299 RHS: -0.523598775598299 Absolute dif

Add a comment
Know the answer?
Add Answer to:
Using format long g, verify the following trigonometric identities by evaluating the left- and right-hand sides...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • solve it by using matlab Question 2) (2.5 points) Examine the following trigonometric identity: sin'(x) =...

    solve it by using matlab Question 2) (2.5 points) Examine the following trigonometric identity: sin'(x) = (3 sin(a) – sin(3.c)) Verify that this identity is valid. To do so, define a variable x as x = 84 (in degrees!). Compute the left and right sides of the identity and assign them to variables p2left and p2right. Because x is in degrees, make sure you are using the correct trig function! Use the help function if you are unsure. Question 1)...

  • Question 1 (1 point) Which of the following is a reason to use functions? Question 1...

    Question 1 (1 point) Which of the following is a reason to use functions? Question 1 options: To make it easier to read by keeping sections of code shorter. To avoid duplicating code. all of the above To make the code more organized. Question 2 (1 point) When the execution of a function ends, what Python code is executed next? Question 2 options: The function is automatically executed again. The line of code immediately after the end of the function....

  • Growing Plant program following guidelines Drawing Canvas Code: import java.awt.Canvas; import java.awt.*; import java.awt.geom.*; /** *...

    Growing Plant program following guidelines Drawing Canvas Code: import java.awt.Canvas; import java.awt.*; import java.awt.geom.*; /** * */ /** */ public class DrawingCanvas extends Canvas { protected String drawString; protected double angleIncrement; DrawingCanvas() { this.setPreferredSize(new Dimension(400, 400)); } public void setDrawString(String s) { drawString = s; } public void setAngleIncrement(double d) { angleIncrement = Math.PI * d/ 180.0; } /** * Paint routine for our canvas. The upper Left hand corner * is 0, 0 and the lower right hand corner...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

  • Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA...

    Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA {    private BigInteger phi; private BigInteger e; private BigInteger d; private BigInteger num; public static void main(String[] args) {    Scanner keyboard = new Scanner(System.in); System.out.println("Enter the message you would like to encode, using any ASCII characters: "); String input = keyboard.nextLine(); int[] ASCIIvalues = new int[input.length()]; for (int i = 0; i < input.length(); i++) { ASCIIvalues[i] = input.charAt(i); } String ASCIInumbers...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT