To solve the differential equation cos(x) dy/dx + sin(x) y = 1, we first rewrite it in a standard form. We start by rearranging the terms.
The given equation can be rewritten as:
dy/dx + (sin(x)/cos(x)) y = 1/cos(x)
This is a first-order linear ordinary differential equation (ODE) of the form:
dy/dx + P(x) y = Q(x)
where:
- P(x) = sin(x)/cos(x) = tan(x)
- Q(x) = 1/cos(x) = sec(x)
Next, we need to find an integrating factor, μ(x), which is given by:
μ(x) = e∫ P(x) dx = e∫ tan(x) dx
The integral of tan(x) is -ln|cos(x)|. Therefore, the integrating factor is:
μ(x) = e-ln|cos(x)| = |cos(x)|-1 = sec(x)
Multiplying the entire ODE by the integrating factor:
sec(x) dy/dx + sec(x) (tan(x) y) = 1
This simplifies to:
d/dx [sec(x) y] = 1
Now, we integrate both sides with respect to x:
∫ d/dx[sec(x) y] dx = ∫ 1 dx
Which gives us:
sec(x) y = x + C
Where C is the constant of integration. Finally, we solve for y:
y = (x + C) cos(x)
Thus, the general solution to the differential equation cos(x) dy/dx + sin(x) y = 1 is:
y = (x + C) cos(x)
where C is any constant.