Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I came across with this integral today in my midterm:

$$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2 $$

And I got two correct answers:

$$\frac {\sec^2(\pi x)}{4\pi} +C$$


$$\frac {\tan^2(\pi x)}{4\pi} + C$$

The first one, I get it by substituting $u=\sec (\pi x)$ and the second one, by substituting $u=\tan (\pi x) $

I already differentiated both answers and got to the same integral, but my question is, if both answers are correct and if it were a definite integral, which answer should I use? Wouldn't they give different results?

share|cite|improve this question
In the last formula replace your $C$ with ${1\over {4\pi}}+K$, which is just another constant. Now use the trig identity mentioned below. You see that you get the other answer. – Maesumi Mar 4 '13 at 22:26
up vote 11 down vote accepted

In your case, the difference between the two is a constant:

$$\sin^2 x + \cos^2 x = 1$$


$$\tan^2 x + 1 = \sec^2 x$$

In general, that will be true as well - integration can only be different up to a constant: consider $g = \int f = h$ and note that $g-h = \int f - \int f = \int 0 = const$.

share|cite|improve this answer
That doesn't answer my question in case it wasn't an indefinite integral. – ChairOTP Mar 4 '13 at 22:23
@ChairOTP: In case it was a definite integral, the extra $1$ in the $\sec^2$ answer for the upper limit would be canceled by the extra $1$ in the $\sec^2$ answer for the lower limit. – robjohn Mar 4 '13 at 22:26
@ChairOTP Fro definite integrals, you would get a constant adjustment factor, i.e. answers would be either $\sec^2 x$ or $\tan^2 x +1$, and in definite integrals, the constant would matter -- same answer would result either way. – gt6989b Mar 4 '13 at 22:26
Thank you so much :) – ChairOTP Mar 4 '13 at 22:28
@ChairOTP no problem, glad to help you. – gt6989b Mar 4 '13 at 22:29

They wouldn't give different answers in a definite integral. Suppose that we want to find $\displaystyle\int_a^b f(x)\,dx$. Let $F(x)$ be one antiderivative of $f(x)$, and let $G(x)$ be another. They differ by a constant, so $G(x)=F(x)+C$ for some constant $C$.

If you use $F(x)$ to evaluate the integral from $a$ to $b$, you get $F(b)-F(a)$.

If you use $G(x)$, you get $G(b)-G(a)$, that is, $(F(b)+C)-(F(a)+C)$. Simplify. The $C$'s cancel.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.