Find a power series for this function $$f'(x) = 2xf(x) + 4x$$
I need to find the power series for $f(x)$, any hints on how this should be approached?
 A: hint: $\dfrac{dy}{dx} = 2x(y+2) \to \dfrac{dy}{y+2} = 2xdx$
A: Suppose that
$$
f(x)=\sum_{k=0}^\infty a_kx^k\tag{1}
$$
Applying the differential equation, we get
$$
\sum_{k=0}^\infty(k+1)a_{k+1}x^k=(4+2a_0)x+\sum_{k=2}^\infty2a_{k-1}x^k\tag{2}
$$
Since the right side of $(2)$ has no constant term, the left side says $a_1=0$.
Whatever we choose for $a_0$, the coefficient of $x$ on the right side is $4+2a_0$. The left side then says that $a_2=2+a_0$.
For higher $k$, equating the coefficients of $x^k$ tells us that
$$
a_k=\frac2k\,a_{k-2}\tag{3}
$$
Since $a_1=0$, $(3)$ says that all the odd powers of $x$ have a coefficient of $0$.
$(3)$ also says that for even $k$, the coefficient of $x^k$ is $\frac{c}{(k/2)!}$, except for $a_0$ which is $c-2$.
Thus, we get the power series
$$
\begin{align}
f(x)
&=c-2+c\sum_{k=1}^\infty\frac{x^{2k}}{k!}\\
&=-2+c\sum_{k=0}^\infty\frac{x^{2k}}{k!}\tag{4}
\end{align}
$$
We might recognize $(4)$ as $f(x)=c\,e^{x^2}-2$.
A: One way to find the power series for $f(x)$ is to get a closed form expression for $f(x)$ then use the standard series expansions.
Your differential equation is a linear first order differential equation, with its standard form being
$$\frac{dy}{dx}-2xy=4x$$
You can solve this in the standard way with an integration factor.
This equation is also separable, so you can also use that standard technique.
A: You have $y' = 2xy + 4x.$  Subtract to have
$$y' - 2xy = 4x. $$
This is a first order linear DE; introduce the integrating factor $\mu(x) = e^{-x^2}$  to get
$$(ye^{-x^2})'=y'e^{-x^2} - 2xye^{-x^2} = 4xe^{-x^2}. $$
Integrate to get
$$ye^{-x^2} = -2e^{-x^2} + C$$
Can you do the rest?
