- #1
outhsakotad
- 32
- 0
Homework Statement
I'm trying to solve this DE: 4xy''+2y'+(cosx)y=0 using a series solution.
nmax = 50;
Remove[a, b]
myalist = Sum[Subscript[a, n]*(4*n^2 - 2*n)*x^(n - 1), {n, 0, nmax}] + Sum[((-1)^k/(2*k)!)*Subscript[a, n - k]*x^(n + k),
{n, 0, nmax}, {k, 0, n}];
Subscript[a, 0] = 1;
myatable = Table[Subscript[a, n + 1] = First[Subscript[a, n + 1] /. N[Solve[Coefficient[myalist, x, n] == 0,
Subscript[a, n + 1]]]], {n, 0, nmax - 1}];
myatable = Prepend[myatable, 1];
f1[x_] := c1*Sum[Subscript[a, n]*x^n, {n, 0, nmax - 1}]
they[x_] := f1[x] + f2[x]
thec = NSolve[{they[1] == 0, they'[1] == 1}, {c1, c2}] // First
pa = Plot[they[x] /. thec, {x, 1, 2}]
outhsakotad said:I honestly don't know how to do it another way... Could you perhaps give me a general idea of the method you are using to get the coefficients?
A series solution to a differential equation with trigonometric coefficients is a method of finding an approximate solution to the equation by representing the solution as a sum of trigonometric functions.
A series solution for a DE with trigonometric coefficients is found by assuming that the solution can be expressed as a power series and substituting it into the differential equation. This results in a recursive relationship between the coefficients of the series, which can then be solved to find the values of the coefficients.
There are several advantages to using a series solution for a DE with trigonometric coefficients. First, it can provide an approximate solution when an exact solution is not possible. Additionally, it can often be used to find solutions to DEs that cannot be solved by other methods. Finally, it can be used to handle complicated boundary conditions that are difficult to solve using other techniques.
Yes, there are limitations to using a series solution for a DE with trigonometric coefficients. This method only works for certain types of differential equations, and it may not always provide an accurate solution. Additionally, it can be time-consuming to determine the coefficients of the series, especially for more complex equations.
The accuracy of a series solution for a DE with trigonometric coefficients is determined by comparing it to the exact solution. The more terms that are included in the series, the more accurate the solution will be. However, including too many terms can also lead to computational errors, so there is a trade-off between accuracy and efficiency.