We'll solve the above problem by using integration by parts,
I=∫eaxcosbxdx
I=eax∫cosbxdx−∫aeax(∫cosbxdx)dx
I=eax[sinbxb]−∫aeax(sinbxb)dx
I=eaxsinbxb−ab∫eaxsinbxdx
Let's use integration by parts again,
I=eaxsinbxb−ab[eax∫sinbxdx−∫aeax(∫sinbxdx)dx]
I=eaxsinbxb−ab[eax[−cosbxb]−∫aeax(−cosbxb)dx]
I=eaxsinbxb−ab[−eaxcosbxb+ab∫eaxcosbxdx]
But we know that,
I=∫eaxcosbxdx
So,
I=eaxsinbxb−ab[−eaxcosbxb+abI]I=eaxsinbxb+aeaxcosbxb2−a2b2I(1+a2b2)I=eaxb2[acosbx+bsinbx]∴I=eaxa2+b2[acosbx+bsinbx]+c.