Matlab Question
Find the taylor series for e^x sin x about x=0 in two ways:
(a) By multiplying the taylor series for e^x and that for sinx.
(b) By using the taylor function directly on e^x sin x.
I found this solution, but I’m having trouble implementing it. Can someone break it down or make it simplier for me (what suppose to be in a scrpit file, what suppose to be in the command window, etc.), or if you have a different way of solving it please share. Thanks in advance.
syms x
E1= taylor(exp(x), 5);
E2= taylor(sin(x), 6);
E1E2= collect(E1*E2)
E3= collect(taylor(exp(x)*sin(x), 6))
Difference= simplify(E1E2 – E3)
E1E2=
E3=
x+x^2+1/3*x^3-1/30*x^5
Difference=
1/2880*x^9+1/720*x^8-1/360*x^7-7/260*x^6