TITLE: Help in finding $\int \frac{x+x\sin x+e^x \cos x}{e^x+x\cos x-e^{x} \sin x} dx$
QUESTION [9 upvotes]: I want to find
$$\int \frac{x+x\sin x+e^x \cos x}{e^x+x\cos x-e^{x} \sin x} dx.$$
But since algebraic, exponential and trigonometric functions are involved I am not able to solve it. Please help in finding it by hand.

REPLY [8 votes]: Note the law of equal peopoetions, we have: $$\frac{1+\sin x}{\cos x}=\frac{\cos x}{1-\sin x} \implies \frac{x(1+\sin x)}{x \cos x}=\frac{e^x \cos x}{e^x-e^x \sin x}=\frac{x+x\sin x+e^x \cos x}{x\cos x+ e^{x}-e^{x} \sin x}$$
So $$\int \frac{x+x\sin x+e^x \cos x}{e^x+x\cos x-e^{x} \sin x} dx= \int \frac{\cos x}{1-\sin x}dx=-\ln (1-\sin x)+C$$