Solving Differential Equations Containing Trigonometric Function Can we find the first five solutions of the differential equation below using Leibnitz-Maclaurin's method?
$$\frac{dy}{dx}+(1+x^{2})y=\sin{x}$$
I tried solving it but got confused after finding the nth differential of $\sin{x} $
If not possible using Leibnitz-Maclaurin's method, how can I solve this question?
 A: This first order ordinary differential equation can be solved using the method of variation of parameters. In this case, you obtain
\begin{equation}
 y(x) = e^{-x(1+x^2 /3)}\left(y(0) + \int_0^x e^{\xi(1+\xi^2 /3)}\sin\xi\,\text{d}\xi\right).
\end{equation}
If you are adamant on using the Leibniz-MacLaurin method, you can use the above to check your solution.
A: Using the power series method you'd get something like this:
First let $f(x) = \sum_{k=0}^\infty{a_kx^k} \Rightarrow f'(x) = \sum_{k=0}^\infty a_{k+1}(k+1)x^k$. Next note that by inserting the powerseries for $f(x)$ that:
$$(1+x^2)f(x) = a_0 +a_1x+\sum_{k=2}^\infty {(a_k+a_{k-2})x^k}.$$
Now let $b_k$ be defined by:
$$b_k = \begin{cases}0 \quad \mbox{if $k$ is even,}\\
        \frac{(-1)^{\frac{k-1}{2}}}{k!} \quad \mbox{if k is odd.} \end{cases} $$
The $\sin(x) = \sum_{k=0}^\infty{b_kx^k} = x+\sum_{k=2}^\infty{b_kx^k}$ (its just a rewrite of the usual formula $\sin(x) = \sum_{k=0}^\infty{(-1)^k \frac{x^{2k+1}}{(2k+1)!}}$).
Now inserting this knowledge into your differential equation we would get, that:
$$a_1+2a_2x +\sum_{k=2}^\infty a_{k+1}(k+1)x^k +a_0 +a_1x + \sum_{k=2}^\infty {(a_k+a_{k-2})x^k} - x-\sum_{k=2}^\infty{b_kx^k} =0$$
Collecting the coefficient to each power of $x$ and setting it equal to 0 we get the following recurrence equations:
\begin{align*}
 &a_1+a_0=0\\
 &2a_2 +a_1 -1 =0\\
 &(k+1)a_{k+1}+a_k+a_{k-1}-b_k=0, \quad  \mbox{ for $k\geq2$.}
\end{align*}
Now from the definition of $f$ we get that $a_0=y(0)$, so this number is known. Then we may successively solve for $a_k$.
Hope that was what you had in mind.
