∫e^x*cos(nx)dx
=∫cos(nx)d(e^x)
=e^x*cos(nx)+n∫e^xsin(nx)dx
=e^x*cos(nx)+n∫sin(nx)d(e^x)
=e^x*cos(nx)+ne^xsin(nx)-n^2∫e^xcos(nx)dx
将-n^2∫e^xcos(nx)dx移动等式右边与右边合并后除以系数,得
∫e^x*cos(nx)dx=(1/(1+n^2))e^x*cos(nx)+ne^xsin(nx)+C
下面将积分限0到π代入得:[注意cos(nπ)=(-1)^n]
=(1/(1+n^2))e^π*(-1)^n-(1/(1+n^2))
=(1/(1+n^2))((-1)^n*e^π-1)