Find the general solution of y''' - 2y' + 4y = e^(-x)cos x +…
Find the general solution of $y''' - 2y' + 4y = e^{-x}\cos x + e^{x}\sin x$.
Explanation of Method
Two exponential-trig terms, one non-resonant and one resonant, are each reduced by an exponential shift D→D±1 to a simpler auxiliary equation.
Step 1: Homogeneous solution
The characteristic equation is $r^3-2r+4=0$. Testing $r=-2$: $(-2)^3-2(-2)+4=-8+4+4=0$, so $r=-2$ is a root. Dividing out $(r+2)$: \[r^3-2r+4=(r+2)(r^2-2r+2)=0, \qquad r^2-2r+2=0 \implies r=\frac{2\pm\sqrt{4-8}}{2}=1\pm i.\]
\[ Y_h = C_1e^{-2x} + e^{x}(C_2\cos x + C_3\sin x). \]
Step 2: Strategy: the exponential shift
Both terms on the right are of the form $e^{\alpha x}\times\text{trig}$. The key tool is the exponential-shift identity: if $y=e^{\alpha x}u$, then for any polynomial operator $L(D)$,
\[ L(D)\bigl[e^{\alpha x}u\bigr] = e^{\alpha x}\,L(D+\alpha)[u]. \] So substituting $y=e^{\alpha x}u$ and dividing out $e^{\alpha x}$ reduces the original equation $L(D)y=e^{\alpha x}g(x)$ to the simpler equation $L(D+\alpha)u=g(x)$ for $u$ — the exponential is peeled off, leaving pure trigonometric undetermined coefficients. By superposition, $y^*=y_1^*+y_2^*$ treats the two right-hand-side terms separately.
Step 3: Part 1: $e^{-x}\cos x$
Here $\alpha=-1,\ \beta=1$, so the associated exponents are $r=-1\pm i$. Checking against the roots $\{-2,\,1\pm i\}$: not a match, so $s=0$. Set $y_1^*=e^{-x}u$, $u=A\cos x+B\sin x$, and shift $D\to D-1$ in $L(D)=D^3-2D+4$:
\[ L(D-1)=(D-1)^3-2(D-1)+4 = D^3-3D^2+3D-1-2D+2+4 = D^3-3D^2+D+5. \] So $u$ must satisfy $u'''-3u''+u'+5u=\cos x$. With $u=A\cos x+B\sin x$: $u'=-A\sin x+B\cos x$, $u''=-A\cos x-B\sin x$, $u'''=A\sin x-B\cos x$. Substituting and collecting $\cos x$ and $\sin x$ coefficients:
\[ \cos x:\ (-B)+3A+B+5A = 8A, \qquad \sin x:\ A+3B-A+5B = 8B. \]
\[ 8A\cos x + 8B\sin x = \cos x \implies A=\frac18,\ B=0, \qquad y_1^* = \frac{e^{-x}\cos x}{8}. \]
Step 4: Part 2: $e^{x}\sin x$ — a resonant sub-problem
Here $\alpha=1,\ \beta=1$, so $r=1\pm i$. This time $r=1\pm i$ is a characteristic root ($s=1$), so the trial is pre-multiplied by $x$: $y_2^*=xe^x(A\cos x+B\sin x)$. Write $y_2^*=e^x v$, $v=x(A\cos x+B\sin x)$, and shift $D\to D+1$ in $L(D)=D^3-2D+4$:
\[ L(D+1)=(D+1)^3-2(D+1)+4 = D^3+3D^2+3D+1-2D-2+4 = D^3+3D^2+D+3. \]
This factors neatly as $(D^2+1)(D+3)$ (check: $(D^2+1)(D+3)=D^3+3D^2+D+3\ \checkmark$), so $v$ satisfies $(D^2+1)(D+3)v=\sin x$.
Step 5: Solve the factored operator in two stages
Let $w=(D+3)v$, so first $(D^2+1)w=\sin x$. Since $r=\pm i$ are roots of $D^2+1$, this stage is itself resonant with $\sin x$, so try $w=x(P\cos x+Q\sin x)$. Substituting, the $x$-dependent terms cancel in $w''+w$, leaving:
\[ w''+w = -2P\sin x+2Q\cos x = \sin x \implies P=-\frac12,\ Q=0, \qquad w=-\frac{x\cos x}{2}. \]
Now solve the first-order equation $(D+3)v=w$, i.e. $v'+3v=-\dfrac{x\cos x}{2}$, by an integrating factor $e^{3x}$: $\frac{d}{dx}\bigl(e^{3x}v\bigr) = -\frac12\,xe^{3x}\cos x.$
Using $\displaystyle\int e^{3x}\cos x\,dx=\frac{e^{3x}(3\cos x+\sin x)}{10}$ and integrating by parts in $x$ once more, \[\int xe^{3x}\cos x\,dx = x\cdot\frac{e^{3x}(3\cos x+\sin x)}{10} - \frac{e^{3x}(8\cos x+6\sin x)}{100}.\] so $v = -\dfrac{x(3\cos x+\sin x)}{20} + \dfrac{8\cos x+6\sin x}{200}$ (an arbitrary-constant homogeneous term is dropped). Multiplying back by $e^x$, the second piece becomes $\dfrac{e^x(8\cos x+6\sin x)}{200}$ — exactly of the form $c_1e^x\cos x+c_2e^x\sin x$, which already belongs to $Y_h$. It may therefore be absorbed into the arbitrary constants $C_2,C_3$ and dropped from $y_2^*$, leaving only the essential part:
\[ y_2^* = -\frac{xe^x(3\cos x+\sin x)}{20}. \]
Step 6: General solution
The solution is recorded in the result below.
Result
Final answer:
\[\boxed{\,y = C_1e^{-2x} + e^{x}(C_2\cos x + C_3\sin x) + \frac{e^{-x}\cos x}{8} - \frac{xe^{x}(3\cos x+\sin x)}{20}\,}\]