I don't know how to prove sin^2(x)+cos^2(x)=1

89 views (last 30 days)
I want to prove this thing by Matlab
sin^2 (x) + cos^2 (x) = 1
Somebody help me.
Please.....

Accepted Answer

KSSV
KSSV on 17 Nov 2020
Edited: KSSV on 17 Nov 2020
There are multiple ways to prove this:
Option 1:
x = rand ;
sin(x)^2+cos(x)^2
Option 2:
syms a b c
sinx = a/c ;
cosx = b/c ;
LHS = sinx^2+cosx^2 ;
In the above we have
Thus LHS = 1

More Answers (3)

Ameer Hamza
Ameer Hamza on 17 Nov 2020
Edited: Ameer Hamza on 17 Nov 2020
If you have symbolic toolbox, you can use isAlways()
syms x
eq = sin(x)^2 + cos(x)^2 == 1;
tf = isAlways(eq)
value of 1 means that it is correct for all values of 'x'.

James Tursa
James Tursa on 17 Nov 2020
Edited: James Tursa on 17 Nov 2020
[cos(x),sin(x)] is defined to be a point on the unit circle, so by definition we have sin^2(x) + cos^2(x) = 1 always. This isn't something to be proved since it is a definition. If you want to demonstrate it with values, you can always just plug stuff in and see that you always get about 1 within numerical floating point errors, or make x symbolic and evaluate the expression. But, this will just be a "feel good" demonstration ... it doesn't prove anything since the result follows directly from the definition.

Bruno Luong
Bruno Luong on 17 Nov 2020
Edited: Bruno Luong on 17 Nov 2020
Definition
exp(x) = sum x^k/factorial(k).
Property (provable here)
exp(x+y) = exp(x)*exp(y)
Definitions
sin(x) = 1/(2i) (exp(ix) - exp(-ix))
cos(x) = 1/2 (exp(ix) + exp(-ix))
Thus using exp(0) = 1, i^2=-1
sin(x)^2 = -1/4 (exp(2ix) + exp(-2ix) -2)
cos(x)^2 = +1/4 (exp(2ix) + exp(-2ix) +2)
When sum it all the exp terms go away and we get
sin(x)^2 + cos(x)^2 = 1
(then one can deduce (sin(x),cos(x)) is point on circle, NOT the opposite definition of sin(x) is abcissa coordinate of point on circle bla bla bla).

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!