Linear Differential Equation $y'-3y-2x^2=0$ Power Series Method

I'm trying to solve this first order linear differential equation using power series method. I have obtained a answer but I can't make it to the simplest form. Here's the problem:

$y'=2x^2 + 3y$

My work:

\begin{align*} y' &= a_1 + 2a_2x + 3a_3x^2 + \ldots = \sum_{n=1}^{\infty}na_nx^{n-1} \\ y &=a_0 + a_1x + a_2x^2 + \ldots = \sum_{n=0}^{\infty}a_nx^{n}\\ \text{so} \\ &a_1 + 2a_2x + 3a_3x^2 + \ldots - 3(a_1x + a_2x^2 + \ldots )-2x^2= 0 \iff (a_1-3a_0)+x(2a_2-3a_1) + x^2(3a_3-3a_2 - 2) + x^3 (4a_4 -3a_3)+x^4(5a_5 - 3a_4) + \ldots = 0 \end{align*} Then, I found that, $a_1 = 3a_0, a_2 = \frac{9}{2}a_0, a_3 = \frac{9}{2}a_0 + \frac{2}{3}, a_4 = \frac{27}{8}a_0 + \frac{6}{12}, a_5 = \frac{81}{40}a_0 + \frac{18}{60}, \ldots$ By substituting each of coefficient to the original $y$, I have

\begin{align*} y &= \sum_{n=0}^{\infty} a_nx^n\\ y &= a_0 + 3a_0 x + \frac{9}{2}a_0 x^2 + \left( \frac{9}{2} a_0 + \frac{2}{3} \right) x^3 + \left(\frac{27}{8}a_0 + \frac{1}{2} \right)x^4 + \left( \frac{81}{40}a_0 + \frac{18}{60} \right) x^5 + ...\\ y &= a_0 + 3a_0 x + \frac{9}{2}a_0 x^2 + \frac{9}{2} a_0 x^3 + \frac{27}{8}a_0 x^4 + \frac{81}{40}a_0 x^5 + \ldots + \frac{2}{3} x^3 + \frac{1}{2} x^4 + \frac{18}{60} x^5 + \ldots\\ y &= a_0 \underbrace{\left[ 1 + 3x + \frac{9}{2}x^2 + \frac{9}{2}x^3 + \frac{27}{8} x^4 + \frac{81}{40}x^5 + \ldots \right] }_{e^{3x}} + \frac{2}{3} x^3 + \frac{1}{2} x^4 + \frac{18}{60} x^5 + \ldots \end{align*} That's my final result, I can't figure out the rest. But I've tried by using integrating factor and I've got this : $y(x) = c_1 e^{3x} - \frac{2}{3}x^2 - \frac{4}{9}x - \frac{4}{27}$

• using integrating factor i got $e^{-3x}(-\frac{2}{3}x^2-\frac{4}{9}x-\frac{4}{27}+c)$ Jun 24, 2018 at 7:22
• I think the most elementary way to solve it is to find homogeneous solution $y_H(x) = Ce^{3x}$ first and to find particular solution, you can guess it is a polynomial of degree $2$. So, write $y_P(x) = ax^2+bx+c$ and find coefficients $a$, $b$ and $c$. Jun 24, 2018 at 9:30
Note that in your last coefficients, $$\frac23=\frac{4}{3^3}\frac{3^3}{3!},~~\frac12=\frac{4}{3^3}\frac{3^4}{4!},~~ \frac{18}{60}=\frac{36}{5!}=\frac{4}{3^3}\frac{3^5}{5!}$$ and so on, so that you get another exponential series for $\frac{4}{27}e^{3x}$ if you compensate for the missing first terms $$\frac{4}{3^3}(1+3x+\frac92x^2)=\frac4{27}+\frac49x+\frac23x^2.$$