Solve the differential equation dy/dx + y*cot(x) = 2*x + x2∗cot(x)x^2*cot(x) given y(pi/2) = 0.

Answer: y=x2−π24csc⁡(x)y = x^2 - \frac{\pi^2}{4}\csc(x)

Step-by-step solution

Step 1: Identify the form of the differential equation

The given differential equation is of the form dydx+ycot⁡(x)=2x+x2cot⁡(x)\frac{dy}{dx} + y\cot(x) = 2x + x^2\cot(x). This is a first-order linear differential equation, which can be written in the standard form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x). By comparing the given equation with the standard form, we can identify P(x)P(x) and Q(x)Q(x).

Step 2: Identify P(x) and Q(x)

From the standard form, we can see that P(x)P(x) is the coefficient of yy and Q(x)Q(x) is the term on the right-hand side of the equation. In this case, P(x)=cot⁡(x)P(x) = \cot(x) and Q(x)=2x+x2cot⁡(x)Q(x) = 2x + x^2\cot(x).

Step 3: Calculate the integrating factor

The integrating factor (IF) for a linear differential equation is given by the formula e∫P(x)dxe^{\int P(x)dx}. We substitute P(x)=cot⁡(x)P(x) = \cot(x) into the formula and integrate. The integral of cot⁡(x)\cot(x) is ln⁡∣sin⁡(x)∣\ln|\sin(x)|. Assuming sin⁡(x)>0\sin(x) > 0 for its domain, the integrating factor simplifies to sin⁡(x)\sin(x).

Step 4: Multiply the differential equation by the integrating factor

Now we multiply both sides of the original differential equation by the integrating factor, sin⁡(x)\sin(x). This step transforms the left-hand side of the equation into the derivative of the product of yy and the integrating factor, which is ddx(y⋅IF)\frac{d}{dx}(y \cdot IF).

Step 5: Simplify the equation

The left-hand side of the equation becomes ddx(ysin⁡(x))\frac{d}{dx}(y\sin(x)) because ddx(ysin⁡(x))=dydxsin⁡(x)+ycos⁡(x)\frac{d}{dx}(y\sin(x)) = \frac{dy}{dx}\sin(x) + y\cos(x). Since cot⁡(x)sin⁡(x)=cos⁡(x)sin⁡(x)sin⁡(x)=cos⁡(x)\cot(x)\sin(x) = \frac{\cos(x)}{\sin(x)}\sin(x) = \cos(x), the equation simplifies to ddx(ysin⁡(x))=2xsin⁡(x)+x2cos⁡(x)\frac{d}{dx}(y\sin(x)) = 2x\sin(x) + x^2\cos(x). We can recognize the right-hand side as the derivative of x2sin⁡(x)x^2\sin(x) using the product rule: ddx(x2sin⁡(x))=2xsin⁡(x)+x2cos⁡(x)\frac{d}{dx}(x^2\sin(x)) = 2x\sin(x) + x^2\cos(x).

Step 6: Integrate both sides

We integrate both sides of the simplified equation with respect to xx. The integral of ddx(ysin⁡(x))\frac{d}{dx}(y\sin(x)) is simply ysin⁡(x)y\sin(x). On the right-hand side, we recognize (2xsin⁡(x)+x2cos⁡(x))(2x\sin(x) + x^2\cos(x)) as the derivative of x2sin⁡(x)x^2\sin(x), so its integral is x2sin⁡(x)+Cx^2\sin(x) + C, where CC is the constant of integration.

Step 7: Solve for y

To find the general solution for yy, we divide both sides of the equation by sin⁡(x)\sin(x). This gives us y=x2sin⁡(x)+Csin⁡(x)y = \frac{x^2\sin(x) + C}{\sin(x)}, which simplifies to y=x2+Ccsc⁡(x)y = x^2 + C\csc(x).

Step 8: Apply the initial condition

We are given the initial condition y(π2)=0y(\frac{\pi}{2}) = 0. We substitute x=π2x = \frac{\pi}{2} and y=0y = 0 into the general solution to find the value of the constant CC. Since csc⁡(π2)=1\csc(\frac{\pi}{2}) = 1, we get 0=π24+C0 = \frac{\pi^2}{4} + C, which means C=−π24C = -\frac{\pi^2}{4}.

Step 9: Substitute C back into the general solution

Finally, we substitute the value of CC back into the general solution for yy. This gives us the particular solution to the differential equation that satisfies the given initial condition.

More from this chapter

All Differential Equations solutions →

Solve your own maths question free →