$$\int \frac{dx}{ax^2 + bx + c} \quad \text{for} \quad 4ac-b^2 >0$$ then $$\begin{align} ax^2 + bx + c &= a\biggl(x+\frac{b}{2a}\biggr)^2 + \frac{4ac-b^2}{4a} \\ &= \Biggl(\sqrt{a}\biggl(x+\frac{b}{2a}\biggr)\Biggr)^2 + \Biggl(\sqrt{\frac{4ac-b^2}{4a}}\Biggr)^2 \end{align}$$ implies $$ \int \frac{dx}{ax^2 + bx + c} = \int \frac{dx}{\Bigl(\sqrt{a}\bigl(x+\frac{b}{2a}\bigr)\Bigr)^2 + \Bigr(\sqrt{\frac{4ac-b^2}{4a}}\Bigr)^2} = \frac{2\sqrt{a}}{\sqrt{4ac-b^2}}\arctan\frac{2ax+b}{\sqrt{4ac-b^2}} $$ The correct answer does not have the $\sqrt{a}$ in the numerator. I've checked over my work, but have clearly made some dumb mistake. Can anyone please let me know where such an error was made? Thank you for your help!
3 Answers
Hard to debug, since some detail is missing. To make things less messy, I would rewrite the integral as $$ \int\frac{4a\,dx}{(2ax+b)^2+4ac-b^2}.$$ Let $4ac-b^2=K^2$. Then let $2ax+b=Ku$. We have $2a \,dx=K\,du$. So our integral is $$\int \frac{2K\,du}{K^2u^2+K^2},$$ which is $$\frac{2}{K}\arctan u+C.$$
Remark: I am not fond of fractions, so for completing the square I prefer to write $$ax^2+bx+c=\frac{1}{4a}\left(4a^2x^2+4abx+4c\right)=\frac{1}{4a}\left((2ax+b)^2-(b^2-4ac) \right).$$
-
$\begingroup$ I did not show every step in order to save time. I like your way much better. Thank you!! $\endgroup$ Dec 8, 2014 at 7:19
-
$\begingroup$ You are welcome. Note also that when people derive the Quadratic Formula, they often first divide $ax^2+bx+c$ through by $a$, creating a mess. I prefer to multiply through by $4a$. Then the quadratic equation becomes $(2ax+b)^2=b^2-4ac$, from which the Quadratic Formula follows quickly. $\endgroup$ Dec 8, 2014 at 7:26
-
$\begingroup$ Nice trick. I will use this method from now on $\endgroup$ Dec 8, 2014 at 7:32
-
$\begingroup$ Found the issue. By letting $ u=\sqrt{a}(x+\frac{b}{2a})$, then $du = \frac{dx}{\sqrt{a}}$. Thus, $\frac{\sqrt{a}}{\sqrt{a}}=1$ and I reach my desired result. Thanks again! $\endgroup$ Dec 8, 2014 at 20:22
I would solve for the roots and use maybe partial fractions, just to be more neat? have you tried that
-
$\begingroup$ I completed the square, and then wrote the denominator as the sum of squares. $\endgroup$ Dec 8, 2014 at 6:37
-
$\begingroup$ but yes. your argument seems right. I teach calcalus and first time I see such a general question. That'ts interesting $\endgroup$– DanielDec 8, 2014 at 6:39
-
$\begingroup$ It is from a table of integrals, and out of curiosity I wanted to show it to be true for myself. $\endgroup$ Dec 8, 2014 at 6:43
-
$\begingroup$ @Daniel Since the discriminate is assumed negative, I don't think partial fractions would be much use here, unless you intend to factor the quadratic into complex linear factors. $\endgroup$– David HDec 8, 2014 at 6:53
-
$\begingroup$ alright. the way the discriminate was presented confused me I guess :). yes, I apologize. $\endgroup$– DanielDec 8, 2014 at 6:55
A way to make diagnosing these types of errors way easier is to pretend your variables are dimensional (i.e. that they have units). Suppose $x$ has units of length (or you could pick mass or time or a made-up unit), which I will write in shorthand as $[x] = L$. Then if $[a] = L^{-2}$ and $[b] = L^{-1}$ and $[c] = 1$ (i.e. $c$ is unitless), the units are consistent and your final answer should have units of length, because $[dx] = L$ and the denominator is unitless. (It's important to make sure the units are consistent when you start, because if you have something like $1 + u^2$ you simply can't assign units to $u$.)
Now just go through your steps and look for the point at which the units stop being consistent. Everything is good up to the next-to-last step you've shown, i.e. this expression
$$\int \frac{dx}{\Bigl(\sqrt{a}\bigl(x+\frac{b}{2a}\bigr)\Bigr)^2 + \Bigr(\sqrt{\frac{4ac-b^2}{4a}}\Bigr)^2}$$
still has the correct units ($[dx] = L$ and denominator unitless), so the error came in somewhere in the steps you didn't show. Obviously, that's all I can say without you showing those steps, but perhaps you can apply this technique to your own private work and see exactly where that extra $\sqrt{a}$ came from.