Let $y=e^x(a\sin x+b\cos x)$. Show $y''=py'+ qy$ for some constants $p$ and $q$; and express all higher derivatives as linear combinations of $y'$ and $y$.
I got to $y''=2y'-2y$, but I'm not sure how to do the linear combinations part, I don't know how to reduce the $n$th derivative to just $y'$ and $y$.
Observe that $$ y=c_1\mathrm{e}^{(1+i)x}+c_2\mathrm{e}^{(1-i)x} $$ where $c_1,c_2$ can be obtain from $$ y=c_1\mathrm{e}^{(1+i)x}+c_2\mathrm{e}^{(1-i)x}=\mathrm{e}^x(a\sin x+b\cos x) $$ i.e., $$ c_1=\frac{b-ai}{2},\quad c_2=\frac{b+ai}{2}. $$ Next, $$ y^{(n)}=c_1(1+i)^n\mathrm{e}^{(1+i)x}+c_2(1-i)^n\mathrm{e}^{(1-i)x} \\=2^{n/2}\mathrm{e}^{x}\big(c_1\mathrm{e}^{ix+n\pi i/4}+c_2\mathrm{e}^{-ix+n\pi i/4}\big)=2^{n/2}\mathrm{e}^{x}\big(a\sin(x+n\pi/4)+b\cos(x+n\pi/4)\big) $$
To get $y^{(n)}$ as a linear combination of $y$ and $y'$ can be done according to: $$ y''-(a+b)y'+aby=0\quad\Longrightarrow\quad y^{(n)}=c_1a^n+c_2b^n $$ In our case $a=1+i,\,b=1-i$ and $$ c_1=\frac{1}{2}\big((1-i)y-iy'\big),\quad c_2=\frac{1}{2}\big((1+i)y+iy'\big) $$ Altogether $$ y^{(n)}=\frac{1}{2}\left(\big((1-i)y-iy'\big)(1+i)^n+\big((1+i)y+iy'\big)(1-i)^n)\right) \\ = \big((1+i)^{n-1}+(1-i)^{n-1}\big)y-i\big((1+i)^{n}-(1+i)^{n}\big)y \\= 2^{(n+1)/2}\cos\Big(\frac{(n-1)\pi}{4}\Big)\,y+2^{(n+2)/2}\sin\Big(\frac{n\pi}{4}\Big)\,y' $$