Solve the differential equation \[ \frac{dy}{dx}=x^2y-3x^2, \qquad y(0)=1. \]
Solution
1. Every solution satisfies\[ \frac{d}{dx} \left( e^{-x^3/3}(y-3) \right) = 0. \]
By the product rule and the differential equation, \[ \begin{aligned} \frac{d}{dx} \left( e^{-x^3/3}(y-3) \right) &= e^{-x^3/3} \left( y'-x^2(y-3) \right)\\ &= e^{-x^3/3} \left( x^2y-3x^2-x^2y+3x^2 \right)\\ &= 0. \end{aligned} \]
2. The initial condition forces\[ e^{-x^3/3}(y-3)=-2. \]
By step 1, the left-hand side is constant. At \(x=0\) it equals \[ e^0(y(0)-3)=1-3=-2. \]
3. The solution is\[ \boxed{ y(x)=3-2e^{x^3/3} }. \]
Solving the identity in step 2 for \(y\) gives the displayed formula.
4. The function in step 3 satisfies both the differentialequation and the initial condition.
For \[ y(x)=3-2e^{x^3/3}, \] we have \[ y'(x)=-2x^2e^{x^3/3}. \] Also \[ x^2y-3x^2 = x^2\left(3-2e^{x^3/3}\right)-3x^2 = -2x^2e^{x^3/3} = y'(x), \] and \[ y(0)=3-2=1. \]
5. Q.E.D.
Steps <1>1–<1>3 show that any solution must be the function in step 3, and step 4 verifies that this function is indeed a solution.