# How to prove correctness of a formula (differential calculus, integral)?

How do I prove the correctness of the following formula relating to the fundamental theorem of calculus?

$$\int \! x\cos{3x} \, \mathrm{d}x = \frac{\cos{3x}}{9}+\frac{x\sin{3x}}{3}+C$$

-
Have you tried to calculate the left hand side? –  Jack Jun 11 '11 at 15:10
It would better if you accept an answer :) –  user9413 Jun 12 '11 at 15:53

Differentiation is easy! Once you have calculated an integral, differentiate your "answer" and see whether you get the right thing.

Of course you have to remember the $+{}C$, since if you differentiate, you will get the same thing as if you had remembered it.

You can even use the idea as a "technique of integration."

Here is a simple example.

We want $\int e^{3x}dx$. Guess that the answer is $e^{3x}+C$.

Now differentiate your answer. If you remember to use the Chain Rule, you will get $3e^{3x}$. So the answer $e^{3x}+C$ was wrong. But that's easy to fix. Divide your "answer" $e^{3x}$ by $3$ to get rid of that nasty $3$ that came from the Chain Rule. You get a new improved answer $\frac{e^{3x}}{3}+C$. If you still have doubts, differentiate that. You will get $e^{3x}$, the thing you were trying to integrate.

Even on a test, if there is time, you can check all your (indefinite) integral answers by differentiating. You probably have roughly $100$ percent mastery of differentiation, and can do it quickly, so a check is always possible, and quick.

-
Thats why differentiation is mechanics and integration is an art :) –  user9413 Jun 11 '11 at 15:32
Until you get to analysis where you learn that (Lebesgue) integration is (in principle) easy and differentiation is hard :) –  kahen Jun 11 '11 at 15:40
In applied work, one finds the same thing! Numerical integration is cheap, stable. Numerical differentiation is a lot more problematical. Calculating $(f(a+h)-f(a))/h$ for tiny $h$ is just asking for numerical trouble. –  André Nicolas Jun 11 '11 at 16:42

Integration by parts would be of great help. Let $u = x$, and let $dv = \cos{3x} \:\rm{dx}$. Then you have $du = dx$ and $v = \frac{\sin{3x}}{3}$. Using the formula we have $$I = \int x \cos{3x} \ \text{dx} = uv - \int v \ \text{du} = \frac{x \cdot\sin{3x}}{3} - \frac{1}{3}\int\sin{3x} \ \text{dx}$$

To see whether your answer is correct differentiate the Right Hand side. So you have $$\frac{1}{9} \cdot -3\sin{3x} + \frac{1}{3} \sin{3x} + x \cos{3x} = x \cos{3x}$$

-