Subjects differential equations

Differential Equation D79054

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **Stating the problem:** Solve the differential equation $$xy^2y' + y^3 = x \cos x$$ for $y$ as a function of $x$. 2. **Rewrite the equation:** The given equation is $$xy^2 \frac{dy}{dx} + y^3 = x \cos x$$. 3. **Isolate $y'$:** Move $y^3$ to the right side: $$xy^2 \frac{dy}{dx} = x \cos x - y^3$$ Divide both sides by $xy^2$ (assuming $x \neq 0$ and $y \neq 0$): $$\frac{dy}{dx} = \frac{x \cos x - y^3}{x y^2} = \frac{\cos x}{y^2} - \frac{y}{x}$$ 4. **Rewrite the equation:** $$\frac{dy}{dx} + \frac{y}{x} = \frac{\cos x}{y^2}$$ 5. **Substitution:** Let $v = y^3$. Then: $$v = y^3 \implies \frac{dv}{dx} = 3y^2 \frac{dy}{dx}$$ 6. **Express $\frac{dy}{dx}$ in terms of $v$:** $$\frac{dy}{dx} = \frac{1}{3y^2} \frac{dv}{dx}$$ 7. **Substitute into the original equation:** $$xy^2 \frac{dy}{dx} + y^3 = x \cos x$$ Replace $y^3$ by $v$ and $y^2 \frac{dy}{dx}$ by $\frac{1}{3} \frac{dv}{dx}$: $$x \cdot \frac{1}{3} \frac{dv}{dx} + v = x \cos x$$ 8. **Simplify:** $$\frac{x}{3} \frac{dv}{dx} + v = x \cos x$$ Multiply both sides by 3: $$x \frac{dv}{dx} + 3v = 3x \cos x$$ 9. **Divide by $x$:** $$\frac{dv}{dx} + \frac{3}{x} v = 3 \cos x$$ 10. **This is a linear first-order ODE in $v$:** $$\frac{dv}{dx} + P(x) v = Q(x)$$ where $P(x) = \frac{3}{x}$ and $Q(x) = 3 \cos x$. 11. **Find integrating factor (IF):** $$\mu(x) = e^{\int P(x) dx} = e^{\int \frac{3}{x} dx} = e^{3 \ln |x|} = |x|^3$$ 12. **Multiply both sides by IF:** $$x^3 \frac{dv}{dx} + 3x^2 v = 3x^3 \cos x$$ 13. **Left side is derivative:** $$\frac{d}{dx} (x^3 v) = 3x^3 \cos x$$ 14. **Integrate both sides:** $$x^3 v = 3 \int x^3 \cos x \, dx + C$$ 15. **Evaluate integral $\int x^3 \cos x \, dx$ using integration by parts:** Let $I = \int x^3 \cos x \, dx$. - First integration by parts: $u = x^3$, $du = 3x^2 dx$, $dv = \cos x dx$, $v = \sin x$ $$I = x^3 \sin x - \int 3x^2 \sin x \, dx$$ - Second integration by parts for $\int x^2 \sin x \, dx$: $u = x^2$, $du = 2x dx$, $dv = \sin x dx$, $v = -\cos x$ $$\int x^2 \sin x \, dx = -x^2 \cos x + \int 2x \cos x \, dx$$ - Third integration by parts for $\int 2x \cos x \, dx$: $u = 2x$, $du = 2 dx$, $dv = \cos x dx$, $v = \sin x$ $$\int 2x \cos x \, dx = 2x \sin x - \int 2 \sin x \, dx = 2x \sin x + 2 \cos x + C$$ - Combine all: $$\int x^2 \sin x \, dx = -x^2 \cos x + 2x \sin x + 2 \cos x + C$$ - Substitute back: $$I = x^3 \sin x - 3(-x^2 \cos x + 2x \sin x + 2 \cos x) + C$$ $$= x^3 \sin x + 3x^2 \cos x - 6x \sin x - 6 \cos x + C$$ 16. **Substitute $I$ back into the expression for $v$:** $$x^3 v = 3I + C = 3(x^3 \sin x + 3x^2 \cos x - 6x \sin x - 6 \cos x) + C$$ $$= 3x^3 \sin x + 9x^2 \cos x - 18x \sin x - 18 \cos x + C$$ 17. **Recall $v = y^3$, so:** $$y^3 = \frac{3x^3 \sin x + 9x^2 \cos x - 18x \sin x - 18 \cos x + C}{x^3}$$ 18. **Final solution:** $$\boxed{y = \sqrt[3]{\frac{3x^3 \sin x + 9x^2 \cos x - 18x \sin x - 18 \cos x + C}{x^3}}}$$ This is the implicit general solution to the original differential equation.