Consider the two equations (E_1): sin x y'' - (cos x+sin…
Consider the two equations $(E_1)\!: \quad \sin x\,y'' - (\cos x+\sin x)y' + \cos x\,y = \cos x$ and $(E_2)\!: \quad y''' - y'' + y' - y = -1$. (a) Show that every solution of $(E_1)$ also satisfies $(E_2)$. (b) Solve both equations. (c) Find the periodic particular solution of $(E_1)$ satisfying $y(0)=2$.
Explanation of Method
A substitution $v=y'-y$ shows every solution of the second-order equation $(E_1)$ solves a third-order equation $(E_2)$; both are solved, and the unique periodic solution of $(E_1)$ through $y(0)=2$ is isolated.
Step 1: Task 1 — every solution of $(E_1)$ satisfies $(E_2)$
Group the terms of $(E_1)$ as
\[ \sin x\,(y''-y') - \cos x\,(y'-y) = \cos x. \]
Introduce $v=y'-y$, so that $v'=y''-y'$. Then $(E_1)$ becomes the first-order relation
\[ \sin x\,v' - \cos x\,v = \cos x. \tag{*} \]
Differentiate $(*)$ with respect to $x$, using the product rule on both terms on the left: $\cos x\,v' + \sin x\,v'' - \bigl(-\sin x\,v + \cos x\,v'\bigr) = -\sin x$.
i.e. \[\cos x\,v' + \sin x\,v'' + \sin x\,v - \cos x\,v' = -\sin x \;\Longrightarrow\; \sin x\,v'' + \sin x\,v = -\sin x.\]
Dividing by $\sin x$ ($\neq0$ away from isolated points): $v'' + v = -1$.
Now substitute back $v=y'-y$, $v'=y''-y'$, $v''=y'''-y''$: \[(y'''-y'') + (y'-y) = -1 \;\Longrightarrow\; y'''-y''+y'-y = -1,\]
which is exactly $(E_2)$. Hence every solution of $(E_1)$ satisfies $(E_2)$. $\blacksquare$
Step 2: Task 2 — solving $(E_1)$
Homogeneous part. Setting the right side of $(*)$ to zero gives $\sin x\,v' = \cos x\,v$, i.e. $dv/v=\cot x\,dx$, so $v=A\sin x$, that is $y'-y=A\sin x$. This is first-order linear in $y$ with integrating factor $e^{-x}$:
\[ \bigl(e^{-x}y\bigr)' = Ae^{-x}\sin x. \]
Using $\displaystyle\int e^{-x}\sin x\,dx = \frac{e^{-x}(-\sin x-\cos x)}{2}$, \[e^{-x}y = A\cdot\frac{e^{-x}(-\sin x-\cos x)}{2} + B \;\Longrightarrow\; y_h = -\frac{A}{2}(\sin x+\cos x) + Be^x.\]
Renaming $-A/2\to C_1$ and $B\to C_2$, $y_h = C_1(\sin x+\cos x) + C_2e^x$.
Particular solution. From $(*)$, $v'-\cot x\,v=\cot x$; the integrating factor $1/\sin x$ gives $(v/\sin x)'=\cos x/\sin^2x$, so $v/\sin x=-1/\sin x+C$, i.e. $v=-1+C\sin x$. Taking the simplest particular branch $v_p=-1$: $y'-y=-1$, so $(e^{-x}y)'=-e^{-x}$, giving $e^{-x}y=e^{-x}+D$, i.e. $y_p=1+De^x$; taking $D=0$ yields $y_p=1$.
General solution of $(E_1)$.
\[ y = C_1(\sin x+\cos x) + C_2e^x + 1 \]
Solving $(E_2)$. The characteristic equation $r^3-r^2+r-1=0$ factors as $r^2(r-1)+(r-1)=(r-1)(r^2+1)=0$, with roots $r=1,\,\pm i$, so $y_h=C_1e^x+C_2\cos x+C_3\sin x$. For a particular solution try the constant $y_p=K$: substituting into $y'''-y''+y'-y=-1$ gives $-K=-1$, so $K=1$.
General solution of $(E_2)$.
\[ y = C_1e^x + C_2\cos x + C_3\sin x + 1 \]
Consistency check: the two-parameter family solving $(E_1)$ is exactly the sub-family of $(E_2)$'s three-parameter solution obtained by matching the coefficients of $\cos x$ and $\sin x$ (setting both equal to the single constant $C_1$ of the $(E_1)$ formula). This is precisely what Task 1 guarantees: every $(E_1)$-solution is an $(E_2)$-solution, but the converse fails whenever the $\cos x$ and $\sin x$ coefficients in the $(E_2)$ solution differ.
Step 3: Task 3 — the periodic solution of $(E_1)$ with $y(0)=2$
In $y=C_1(\sin x+\cos x)+C_2e^x+1$, the term $C_2e^x$ is unbounded (hence non-periodic) unless $C_2=0$. Setting $C_2=0$ leaves
\[ y = C_1(\sin x+\cos x) + 1, \]
which is periodic with period $2\pi$ for every $C_1$. Applying $y(0)=2$: \[C_1(\sin0+\cos0) + 1 = C_1 + 1 = 2 \;\Longrightarrow\; C_1 = 1.\]
Step 4: Verification
With $y=\sin x+\cos x+1$: $y'=\cos x-\sin x$, $y''=-\sin x-\cos x$. Substituting into $(E_1)$: $\sin x(-\sin x-\cos x) - (\cos x+\sin x)(\cos x-\sin x) + \cos x(\sin x+\cos x+1) = \cos x$. $\checkmark$
Also $y(0)=0+1+1=2\ \checkmark$, and $y$ manifestly has period $2\pi\ \checkmark$. Finally, by Task 1 this $y$ also satisfies $(E_2)$; direct substitution of $y=\sin x+\cos x+1$ into $y'''-y''+y'-y$ gives $-1$ exactly, matching the right-hand side of $(E_2)$.
Result
Final answer:
\[\boxed{\,y = \sin x + \cos x + 1\,}\]