symbolic of cos with power

2 views (last 30 days)
student
student on 7 Apr 2014
Answered: Karan Gill on 9 Dec 2016
I have a long equation with cosine with powers (e.g., (cos(a))^3, (cos(a))^5, ..). Then I need to reduce each power of cosine to unity (but angle is higher): e.g., (cos(a))^2 -> (1+cos(2a))/2.
Here are more examples which reduce various powers:
Anyone who knows how to reduce my cosines to unity of power of cosine, using symbolic of matlab?

Answers (1)

Karan Gill
Karan Gill on 9 Dec 2016
Here, you want to change the input of "cos" from "x" to "2*x". Essentially, you want make the argument of "cos" more complicated. The "combine" command does that.
syms x
f = cos(x)^2;
combine(f,'sincos')
ans =
cos(2*x)/2 + 1/2

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!