Evaluating the integral: $I = \int e^{\frac xa} \sin x \, \mathrm dx$

Evaluating the integral:

$$I = \int e^{\frac xa} \sin x \, \mathrm dx \tag {1}$$

This question was asked in CBSE Board 12th Grade (India). So, here was the approach I made.

Proposition 1: $$for, \, y= u(x), \forall \, x \in \mathbb{R}$$

$$\int e^{\frac xa} u(x) \, \mathrm dx = a e^{\frac xa} \left ( au(x) - a^2\dfrac{\mathrm du(x)}{\mathrm dx} + a^3\dfrac{\mathrm d^2u(x)}{\mathrm dx^2} - \dots \right ) \quad \dots\tag {*}$$

Proof: This can easily be proved by applying by parts in LHS and subtracting it with RHS to a quantity which can be made small than any other assignable quantity as required.

So, using the same to evaluate the integral $$(1)$$, we get:

$$I = ae^{\frac xa} \left ( (\sin x) - (\cos x) + (-\sin x) - (-\cos x) + (\sin x) - (\cos x) + (-\sin x) - (-\cos x) + (\dots) \right)$$

Clearly, the repetitions of sine and cosine functions inside the brackets in RHS are cancelling each other, so irrespective of the value of $$x$$, the series should converge to '0'.

$$\therefore I = 0$$

But, wait, the integrand is continuous and is strictly increasing and strictly decreasing for particular intervals of $$x$$. This is enough to show that my answer is wrong, but what I missed?

Edit: This question is more like why my approach failed then What is the correct way to find the solution of the question

Edit 2: Thanks to @J.G for pointing out that my proposition had issues. I've fixed that part now :)

• It actually oscillates among $\pm\sin x,\pm\cos x$ – lab bhattacharjee Aug 14 '19 at 17:34
• Don't use dfrac in exponents. It looks really bad and confusing. – Cameron Williams Aug 14 '19 at 17:44
• Where does this proposition come from? – JacobCheverie Aug 14 '19 at 17:48
• @JacobCheverie I made that to solve the question easily – user427802 Aug 14 '19 at 17:51

2 Answers

There are several issues here.

1. Your $$(\ast)$$ should read $$\int e^{x/a}u(x)dx=e^{x/a}(au-a^2u^\prime+a^3u^{\prime\prime}-\cdots)+C$$.
2. We have $$\int e^{x/a}\sin xdx=e^{x/a}(a\sin x-a^2\cos x-a^3\sin x+\cdots)+C$$. Thanks to the powers of $$a$$, you can use a geometric series, $$\frac{a}{1+a^2}e^{x/a}(\sin x-a\cos x)+C$$. You can verify by differentiation this is correct.
3. There are certain convergence issues we have to either address or gloss over to use $$(\ast)$$, or the geometric series above. (You can understand the $$a\to1^-$$ limit with a careful understanding of this.) A safer approach is @user1337's or, if you're happy with complex methods, $$\int e^{x/a}\sin xdx=\Im\int e^{(1/a+i)x}dx=\Im\frac{1}{1/a+i}e^{(1/a+i)x}+C,$$which gets you to the above result fairly quickly. (For complex $$a$$, write the integrand as $$\frac{e^{(1/a+i)x}-e^{(1/a-i)x}}{2i}$$ instead.)
• That's very brilliant! While making propositions in the exam, I also missed that part that it has convergence issues as $a \rightarrow 1^-$. I thik that was worth mentioning. I'd appreciate if you tell me how the convergence of the series $+1-1+\dots$ is solved using complex integrals! :-) – user427802 Aug 14 '19 at 17:57
• @AbhusKumarSinha Complex integrals don't address the Grandi series; they just save you using $(\ast)$. The $a\to1^-$ limit $\frac12 e^x(\sin x-\cos x)+C$ makes sense if, when looking at $e^x(\sin x-\cos x-\sin x+\cos x+\cdots)+C$, you argue $1-1+1-1+\cdots=\frac12$. Wikipedia's "unrigorous methods" defend this claim. The series doesn't actually converge, at least not if you use the usual definition of the $n\to\infty$ limit of the $n$th partial sum. But certain other series-summing definitions capture the sorts of intuition that give this idea. – J.G. Aug 14 '19 at 18:01
• Grandi's series seem very controversial! As far as I understand Real Analysis, they still look divergent to me. I'd leave the series as undefined in case of $a \rightarrow 1^-$ – user427802 Aug 14 '19 at 18:06
• @AbdusKumarSinha That's wise. But if you compute the $a\to1^-$ limit instead, you get the same result as for $a=1$ without $(\ast)$. – J.G. Aug 14 '19 at 18:09
• @AbhasKumarSinha You have it backwards: the condition $|a|<1$ is needed for $(\ast)$ to hold, i.e. for the series to equal the integral, because otherwise the series doesn't converge. This condition is not required for the integral itself to exist! That happens for any $a$, viz. 3. – J.G. Aug 14 '19 at 18:20

HINT \begin{align*} \int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)\sin(x) - a\int\exp\left(\frac{x}{a}\right)\cos(x)\mathrm{d}x \end{align*}

Analogously, we have \begin{align*} \int\exp\left(\frac{x}{a}\right)\cos(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)\cos(x) + a\int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x \end{align*}

Therefore we have \begin{align*} \int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x = a\exp\left(\frac{x}{a}\right)(\sin(x) - a\cos(x)) - a^{2}\int\exp\left(\frac{x}{a}\right)\sin(x)\mathrm{d}x \end{align*}

Can you take it from here?