Can only find one double angle formula of cos(2x).

조회 수: 9 (최근 30일)
Kevin
Kevin 2021년 9월 10일
댓글: Jan 2021년 9월 10일
close all
clear
clc
syms x
expand (cos(2*x))
ans =
2*cos(x)^2 - 1
That is one of the three double angle formulas for cos(2x).
How do I get matlab to show the other two double angle formulas?

채택된 답변

Star Strider
Star Strider 2021년 9월 10일
Experiment with various options to get at least one more identity —
syms x
f(x) = cos(2*x)
f(x) = 
f1 = expand (f)
f1(x) = 
f2 = rewrite(f, 'exp')
f2(x) = 
f3 = rewrite(f2, 'sin')
f3(x) = 
.
  댓글 수: 5
Star Strider
Star Strider 2021년 9월 10일
@John D'Errico Thank you!
.
Jan
Jan 2021년 9월 10일
@John Ooi: He adds:
0 = 1 - 1 = 1 - (sin(x)^2 + cos(x)^2) = ...
= 1 - sin(x)^2 - cos(x)^2
@John D'Errico: Yes, Matlab does not care, because all these expressions are equivalent. But I was curious how to bring the symbolic engine to express the different forms. Thanks for showing this.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by