Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. Two trigonometric identities are given by: tan 3x (3 tan x -tan\'x)/(1 13tanx

ID: 2249898 • Letter: 2

Question

2. Two trigonometric identities are given by: tan 3x (3 tan x -tan'x)/(1 13tanx) tan x/2= sin x (eq. 1) . . (eq.2) 1tcos x For each function, verify that the identity is correct by separately calculating the values of the Left and Right- Hand Sides of the equation. Fill in the following table. Watch for the difference between radians (rad) and degrees (deg) tan(3x) .9316 4831 .6359 RHS of eq. 1 tanx/2) 0.25 (rad) 0.15 (rad) 4 (rad) 45 (deg) 30 (deg) RHS of eq. 2 0.1257 0751 2027 0.4142 2679 -3.4874 0.9316 0.1257 .8751 2027 0.4142 2679 -3.4874 4831 -.6359 Inf 9.5144 Inf -9.5144 212 (deg) 3. You are asked to construct a vector x which contains values from 0 to 180 degrees in 4 degree increments the MATLAB expression to accomplish this? Copy this command into your script. x (0: 4: 180)

Explanation / Answer

2. Use the following MATLAB program for Question 2. See the comments to know the details about the commands.

%%%% MATLAB PROGRAM FOR QUESTION 2 BEGINS HERE %%%%%%%%%%%%%%%%%%

clc;
close all;
clear all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Inorder to fill the table entries, run this file by substituing different values of x as asked
% in the table. Observer the LHS and RHS printed at the MATLAB terminal. LHS and RHS
% for both the identities will be printed by this program. Note that the value of x may be
% degrees or radians. You have to set the variable 'unit' in line no. 11 of this program to
% choose betewen degrees and radians. If randians, set unit = 'r', or if in degrees, set unit = 'd'.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% Input value of x in the following line.
x = 212

%%% Set the unit variable given below to 'r' if you need the answer in randians,
%%% or 'd' if you want the answer in degrees.

unit = 'd';

if (unit == 'd')
    x = x*(pi/180);
end

%%%%%% Identity 1 %%%%%%%%%%%
disp(['LHS of identity 1 = tan(3x) = ',num2str(tan(3*x))]);

RHS = (3*tan(x)-(tan(x))^3)/(1-(3*(tan(x))^2));
disp(['RHS of equation 1 = ',num2str(RHS)]);
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%% Identity 2 %%%%%%%%%%%
disp(['LHS of identity 2 = tan(x/2) = ',num2str(tan(x/2))]);

RHS = sin(x)/(1+(cos(x)));
disp(['RHS of equation 2 = ',num2str(RHS)]);

%%%% MATLAB PROGRAM FOR QUESTION 2 ENDS HERE %%%%%%%%%%%%%%%%%%

3. Question 3 contains 5 parts. The answer to the first part is shown in the question paper itself. The MATLAB program for the remaining 4 parts is given below. Part 2,3,4 and 5 are shown as comments in the program.

%%%% MATLAB PROGRAM FOR QUESTION 3 BEGINS HERE %%%%%%%%%%%%%%%%%%

clc;
close all;
clear all;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Use this MATLAB program for Question 3. Please see the comments which describe all the %necessary answers.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%% PART 1 (Answer is already there in the question paper) %%%%%%%%%%
%% Construct a vector x which contains values from 0 to 180 degrees in 4 degree increments. Use the %% following command to accomplish this. (This answer is already filled in the question paper.)
x = 0:4:180;

%%%%%%%%%%%%%%%%%% PART 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% How would you use this vector (i.e., vector x) to calculate RHS of equation 1. Assign the result to %% a variable named out1. Use the following commands to accomplish this. Copy these commands %% to your script.

% First convert all the vector elements from degrees to randians. Because, MATLAB's sin, cos, tan etc. %% work on randians.
y = x*(pi/180);

% Now compute RHS of equation 1 and assign it to the variable out1
out1 = (3*tan(y)-(tan(y)).^3)./(1-(3*(tan(y)).^2));

%%%%%%%%%%%%%%%%%% PART 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Enter the commands to plot out1 vs x. Label x and y axes with appropriate text. Use the following % commands to accomplish this. Copy this to your script.
plot(x,out1);
xlabel('x in degrees');
ylabel('RHS of equation 1');


%%%%%%%%%%%%%%%%%% PART 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% How would you select the values of x and out1 that are in the following ranges: xx1 is from 0 to % 90 degrees. Also choose the corresponding values of out1. We use a variable 'out11' to store the
% values of out1 corresponding to xx1. Use the following command to accomplish this.

% First, get the vector indices of x such that x is in the range 0 to 90 degrees. Then use these vector %indices to index the variable out1 to get the corresponding values. Use the following commands. %Copy these to your script.
ind = find(x >= 0 & x<= 90);
xx1 = x(ind);
out11 = out1(ind);


%% xx2 is from 45 to 135 degrees. Also choose the corresponding values of out1. We use a variable %'out12' to store the values of out1 corresponding to xx2. Use the following command to accomplish %this.

% First, get the vector indices of x such that x is in the range 45 to 135 degrees. Then use these vector % indices to index the variable out1 to get the corresponding values. Use the following commands. %Copy these to your script.
ind = find(x >= 45 & x<= 135);
xx2 = x(ind);
out12 = out1(ind);


% xx3 is from 90 to 180 degrees. Also choose the corresponding values of out1. We use a variable %'out13' to store the values of out1 corresponding to xx3. Use the following command to accomplish %this.

% First, get the vector indices of x such that x is in the range 90 to 180 degrees. Then use these vector % indices to index the variable out1 to get the corresponding values. Use the following commands. %Copy these to your script.
ind = find(x >= 90 & x<= 180);
xx3 = x(ind);
out13 = out1(ind);


%%%%%%%%%%%%%%%%%% PART 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Given xx1 and xx3, how would you reconstitute the full original vetor x ? Use the following %command to accomplish this. Copy this to your script. We are going to name the reconstituted %variable as z. So, after running the following command, the z that you get should exactly match %with x, because you have reconstituted it from xx1 and xx3.
z = [xx1;xx3];

%%%% MATLAB PROGRAM FOR QUESTION 3 ENDS HERE %%%%%%%%%%%%%%%%%%

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote