I want to prove this thing by Matlab
sin^2 (x) + cos^2 (x) = 1
Somebody help me.
Please…..
MATLABprovesin^2(x)+cos^2(x)=1
syms x a bc = (x*cos(x)*sin(x))/(a^2*cos(x)^2 + b^2*sin(x)^2)^2;c_int = int(c, x, 0, pi/1);x = subs(c_int, [a b], [1 2]);
>> xx =-pi/12
>> syms x real>> A = sym([1 -2*cos(x) 0; -sin(x)/cos(x)*sin(x) 1 cos(x); 1 -2*sin(x)/cos(x)*sin(x) 2]) A = [ 1, -2*cos(x), 0][ -sin(x)^2/cos(x), 1, cos(x)][ 1, -(2*sin(x)^2)/cos(x), 2]>> [V,D]=eig(A) V = [ ((cos(x)^4 + 3*cos(x)^2*sin(x)^2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3) + 4/3))/(cos(x)^4 - 2*sin(x)^6) - (2*(cos(x)^4 + cos(x)^2*sin(x)^4 + cos(x)^2*sin(x)^2))/(cos(x)^4 - 2*sin(x)^6) - (cos(x)^2*sin(x)^2*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3) + 4/3)^2)/(cos(x)^4 - 2*sin(x)^6), - (2*(cos(x)^4 + cos(x)^2*sin(x)^4 + cos(x)^2*sin(x)^2))/(cos(x)^4 - 2*sin(x)^6) - ((cos(x)^4 + 3*cos(x)^2*sin(x)^2)*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 + (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3))/(cos(x)^4 - 2*sin(x)^6) - (cos(x)^2*sin(x)^2*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 + (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3)^2)/(cos(x)^4 - 2*sin(x)^6), - (2*(cos(x)^4 + cos(x)^2*sin(x)^4 + cos(x)^2*sin(x)^2))/(cos(x)^4 - 2*sin(x)^6) - ((cos(x)^4 + 3*cos(x)^2*sin(x)^2)*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 - (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3))/(cos(x)^4 - 2*sin(x)^6) - (cos(x)^2*sin(x)^2*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 - (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3)^2)/(cos(x)^4 - 2*sin(x)^6)][ ((3*cos(x)^3 + 2*cos(x)*sin(x)^4)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3) + 4/3))/(2*(cos(x)^4 - 2*sin(x)^6)) - (cos(x)^3 + 2*cos(x)*sin(x)^4 + cos(x)^3*sin(x)^2)/(cos(x)^4 - 2*sin(x)^6) - (cos(x)^3*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3) + 4/3)^2)/(2*(cos(x)^4 - 2*sin(x)^6)), - (cos(x)^3 + 2*cos(x)*sin(x)^4 + cos(x)^3*sin(x)^2)/(cos(x)^4 - 2*sin(x)^6) - ((3*cos(x)^3 + 2*cos(x)*sin(x)^4)*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 + (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3))/(2*(cos(x)^4 - 2*sin(x)^6)) - (cos(x)^3*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 + (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3)^2)/(2*(cos(x)^4 - 2*sin(x)^6)), - (cos(x)^3 + 2*cos(x)*sin(x)^4 + cos(x)^3*sin(x)^2)/(cos(x)^4 - 2*sin(x)^6) - ((3*cos(x)^3 + 2*cos(x)*sin(x)^4)*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 - (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3))/(2*(cos(x)^4 - 2*sin(x)^6)) - (cos(x)^3*(1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 - (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 4/3)^2)/(2*(cos(x)^4 - 2*sin(x)^6))][ 1, 1, 1] D = [ 1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) + (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3) + 4/3, 0, 0][ 0, 4/3 - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 - (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)), 0][ 0, 0, 4/3 - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)/2 + (3^(1/2)*(1/(9*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3)) - (((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))*1i)/2 - 1/(18*(((cos(x)^2 + sin(x)^2 - 1/27)^2 - 1/729)^(1/2) - cos(x)^2 - sin(x)^2 + 1/27)^(1/3))] >> D=simplify(diag(D),300) % unclear why D(1) doesn't simplify to 2 - 1i
D = 2 - (2*(-1)^(1/3)*(2*3^(1/2) - 3)*(- 15*3^(1/2) - 26)^(1/3))/3 - 3^(1/2)/3 0 2 + 1i >> V2=V(:,2); % pick the eigenvector associated with lamda = 0
>> simplify(imag(V2),100) % verify the imaginary part is 0
ans = 0 0 0 >> V2=real(V2); % grab the real part
>> V2=simplify(V2,100) V2 = - 1/cos(2*x) - 1 -cos(x)/(2*cos(x)^2 - 1) 1 >> simplify(V2*(1-2*sin(x)^2),100) ans = -2*cos(x)^2 -cos(x) cos(2*x)
Best Answer