<s>[INST] Evaluate: $\int e^{x^4}(x+x^3+2x^5)e^{x^2} dx$ Evaluate:

$$\int e^{x^4}(x+x^3+2x^5)e^{x^2} dx$$

I know the answer of this integral but got stuck at how to solve this. It seems to be the form like $ \int e^x(f(x)+f''(x))dx = e^x f(x)+C$
 [/INST] $$\begin{aligned}
\int e^{x^4+x^2}\left ( x+x^3+2x^5 \right )\,dx &=\frac{1}{2}\int e^{x^4+x^2}\left ( 2x+2x^3+4x^5 \right )\,dx \\ 
 &= \frac{1}{2}\int \left ( 2xe^{x^4+x^2}+x^2e^{x^4+x^2}\left ( 4x^3+2x \right ) \right )\,dx\\ 
 &= \frac{1}{2}\int \left [ \left ( x^2 \right )'e^{x^2+x^4}+x^2 \left ( e^{x^4+x^2} \right )' \right ]\,dx\\ 
 &= \frac{1}{2}\int \left ( x^2e^{x^2+x^4} \right )'\,dx\\ 
 &= \frac{1}{2}x^2e^{x^2+x^4}+c, \;\; c \in \mathbb{R}
\end{aligned}$$
</s>