# General solution of $\frac{dx}{dt} - 2tx=t^3$

I'm trying to find the general solution of the following first order differential equation (using the integrating factor method): $$\frac{dx}{dt} - 2tx=t^3$$

I found the integrating factor to be $\mathrm{e}^{-t^2}$ meaning I would have to integrate $$\frac{t^3}{\mathrm{e}^{-t^2}}$$ but I don't know how to integrate this. can anyone help?

-
A few helpful comments on posing questions at MSE: 1. You should never use double dollar signs in the title of a post. 2. Please see my comment (in your other recent question) about putting the exponent in brackets so that your question renders correctly. 3. It is discouraged to ask very related question back to back in such a quick manner. Pore over the answers in your previous question, and then try and tackle this one. –  JavaMan Feb 20 '13 at 16:05

Your integrating factor is correct, but your integral is off. Multiplying by the integrating factor yields

$$e^{-t^2}x'-2te^{-t^2}x=(e^{-t^2}x)'=t^3e^{-t^2}$$

$$e^{-t^2}x=\int t^3e^{-t^2}dt$$

$$u=t^2,du=2tdt$$

$$\int t^3e^{-t^2}dt=\frac12\int ue^{-u}du=$$

$$-\frac12ue^{-u}+\frac12\int e^{-u}du=-\frac12e^{-u}(u+1)$$

$$e^{-t^2}x=-\frac12e^{-t^2}(t^2+1)+C$$

$$x=-\frac12(t^2+1)+Ce^{t^2}$$

-

$$\int \frac{t^3}{e^{-t^2}}dt = \int t^3e^{t^2}dt$$ Let $u=t^2\implies du=2tdt$

Now we have: $$\frac{1}{2}\int t^2e^udu=\frac{1}{2}\int ue^udu$$

Now integrate by parts.

The idea of the integrating factor comes from an observation that $$t^3 = \frac{\mathrm{d} x(t)}{\mathrm{d} t} - 2 t x(t) = \mathrm{e}^{t^2} \frac{\mathrm{d}}{\mathrm{d} t} \left( \mathrm{e}^{-t^2} x(t) \right)$$ Thus the solution to the equation is $$\mathrm{e}^{-t^2} x(t) = x_0 + \int_0^t \mathrm{e}^{-s^2} s^3 \mathrm{d} s = x_0 + \int_0^t \mathrm{e}^{-s^2} s^2 \mathrm{d} \left( \frac{s^2}{2} \right) \stackrel{u = s^2}{=} x_0 + \frac{1}{2} \int_0^{t^2} \mathrm{e}^{-u} u \mathrm{d} u$$ The latter integral can be integrated by parts, giving: $$x(t) = \left(x_0 + \frac{1}{2} \right) \mathrm{e}^{t^2} - \frac{1+t^2}{2}$$