hcju/proofwikiqa huggingface dataset:
{{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {x \left({a x + b}\right)^2}       | r = \int \left({\frac 1 {b^2 x} - \frac a {b^2 \left({a x + b}\right)} - \frac a {b \left({a x + b}\right)^2} }\right) \ \mathrm d x       | c = Partial Fraction Expansion }} {{eqn | r = \frac 1 {b^2} \int \frac {\mathrm d x} x - \frac a {b^2} \int \frac {\mathrm d x} {a x + b} - \frac a b \int \frac {\mathrm d x} {\left({a x + b}\right)^2}       | c = Linear Combination of Integrals }} {{eqn | r = \frac 1 {b^2} \ln \left\vert{x}\right\vert - \frac a {b^2} \int \frac {\mathrm d x} {a x + b} - \frac a b \int \frac {\mathrm d x} {\left({a x + b}\right)^2} + C       | c = Primitive of Reciprocal }} {{eqn | r = \frac 1 {b^2} \ln \left\vert{x}\right\vert - \frac a {b^2} \ln \left\vert{a x + b}\right\vert - \frac a b \int \frac {\mathrm d x} {\left({a x + b}\right)^2} + C       | c = Primitive of $\dfrac 1 {a x + b}$ }} {{eqn | r = \frac 1 {b^2} \ln \left\vert{x}\right\vert - \frac a {b^2} \ln \left\vert{a x + b}\right\vert - \frac a b \frac {-1} {a \left({a x + b}\right)} + C       | c = Primitive of $\dfrac 1 {\left({a x + b}\right)^2}$ }} {{eqn | r = \frac 1 {b \left({a x + b}\right)} + \frac 1 {b^2} \ln \left\vert{\frac x {a x + b} }\right\vert + C       | c = Difference of Logarithms and rearranging }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {x \paren {a x + b}^2}       | r = \int \frac {b \rd x} {b x \paren {a x + b}^2}       | c = multiplying top and bottom by $b$ }} {{eqn | r = \int \frac {\paren {a x + b - a x} \rd x} {b x \paren {a x + b}^2}       | c = adding and subtracting $a x$ }} {{eqn | r = \frac 1 b \int \frac {\paren {a x + b} \rd x} {x \paren {a x + b}^2} - \frac a b \int \frac {x \rd x} {x \paren {a x + b}^2}       | c = Linear Combination of Integrals }} {{eqn | r = \frac 1 b \int \frac {\d x} {x \paren {a x + b} } - \frac a b \int \frac {\d x} {\paren {a x + b}^2}       | c = simplifying }} {{eqn | r = \frac 1 b \paren {\frac 1 b \ln \size {\frac x {a x + b} } } - \frac a b \int \frac {\d x} {\paren {a x + b}^2} + C       | c = Primitive of $\dfrac 1 {x \paren {a x + b} }$ }} {{eqn | r = \frac 1 {b^2} \ln \size {\frac x {a x + b} } - \frac a b \paren {-\frac 1 {a \paren {a x + b} } } + C       | c = Primitive of $\dfrac 1 {\paren {a x + b}^2}$ }} {{eqn | r = \frac 1 {b \paren {a x + b} } + \frac 1 {b^2} \ln \size {\frac x {a x + b} } + C       | c = simplifying }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {x \paren {x^2 + a^2} }       | r = \int \paren {\frac 1 {a^2 x} - \frac x {a^2 \paren {x^2 + a^2} } } \rd x       | c = Partial Fraction Expansion }} {{eqn | r = \frac 1 {a^2} \int \frac {\d x} x - \frac 1 {a^2} \int \frac {x \rd x} {x^2 + a^2}       | c = Linear Combination of Integrals }} {{eqn | r = \frac 1 {a^2} \ln \size x - \frac 1 {a^2} \int \frac {x \rd x} {x^2 + a^2} + C       | c = Primitive of Reciprocal }} {{eqn | r = \frac 1 {a^2} \ln \size x - \frac 1 {a^2} \paren {\frac 1 2 \, \map \ln {x^2 + a^2} } + C       | c = Primitive of $\dfrac x {x^2 + a^2}$ }} {{eqn | r = \frac 1 {2 a^2} \map \ln {\frac {x^2} {x^2 + a^2} } + C       | c = Difference of Logarithms }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {x \paren {x^2 + a^2} }       | r = \int \frac {a^2 \rd x} {a^2 x \paren {x^2 + a^2} }       | c = multiplying top and bottom by $a^2$ }} {{eqn | r = \int \frac {\paren {x^2 + a^2 - x^2} \rd x} {a^2 x \paren {x^2 + a^2} }       | c = adding and subtracting $x^2$ }} {{eqn | r = \frac 1 {a^2} \int \frac {\paren {x^2 + a^2} \rd x} {x \paren {x^2 + a^2} } - \frac 1 {a^2} \int \frac {x^2 \rd x} {x \paren {x^2 + a^2} }       | c = Linear Combination of Integrals }} {{eqn | r = \frac 1 {a^2} \int \frac {\d x} x - \frac 1 {a^2} \int \frac {x \rd x} {x^2 + a^2}       | c = simplifying }} {{eqn | r = \frac 1 {a^2} \ln \size x - \frac 1 {a^2} \int \frac {x \rd x} {x^2 + a^2} + C       | c = Primitive of Reciprocal }} {{eqn | r = \frac 1 {a^2} \ln \size x - \frac 1 {a^2} \paren {\frac 1 2 \map \ln {x^2 + a^2} } + C       | c = Primitive of $\dfrac x {x^2 + a^2}$ }} {{eqn | r = \frac 1 {2 a^2} \map \ln {\frac {x^2} {x^2 + a^2} } + C       | c = Difference of Logarithms }} {{end-eqn}} {{qed}}
From Primitive of Reciprocal of x by Power of x plus Power of a: :$\displaystyle \int \frac {\mathrm d x} {x \left({x^n + a^n}\right)} = \frac 1 {n a^n} \ln \left\vert{\frac {x^n} {x^n + a^n} }\right\vert + C$ So: {{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {x \left({x^2 + a^2}\right)}       | r = \frac 1 {2 a^2} \ln \left\vert{\frac {x^2} {x^2 + a^2} }\right\vert + C       | c = Primitive of $\dfrac 1 {x \left({x^n + a^n}\right)}$ with $n = 2$ }} {{eqn | r = \frac 1 {2 a^2} \ln \left({\frac {x^2} {x^2 + a^2} }\right) + C       | c = Absolute Value of Even Power }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = x \sqrt {a x^2 + b x + c}       | r = \frac x {\paren {a x^2 + b x + c}^{-\frac 1 2} }       | c =  }} {{eqn | r = \frac{x \paren {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} } {\paren {a x^2 + b x + c}^{-\frac 1 2} \paren {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} }       | c =  }} {{eqn | r = \frac{x \paren {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} } {2 \sqrt c + \paren {b x + 2 c} \paren {a x^2 + b x + c}^{-\frac 1 2} }       | c =  }} {{eqn | r = \frac N D       | c =  }} {{eqn-intertext | where:}} {{eqn | l = N       | r = \frac {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} x       | c =  }} {{eqn | l = D       | r = \frac {2 \sqrt c + \paren {b x + 2 c} \paren {a x^2 + b x + c}^{-\frac 1 2} } {x^2}       | c =  }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \frac {\d N} {\d x}       | r = \frac {x \paren {\sqrt c \paren {2 a x + b} \paren {a x^2 + b x + c}^{-\frac 1 2} + b} - \paren {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} } {x^2}       | c =  }} {{eqn | r = \paren {a x^2 + b x + c}^{-\frac 1 2} \frac {\paren {\sqrt c \paren {2 a x^2 + b x} + b x \sqrt {a x^2 + b x + c} } - \paren {2 \sqrt c \paren {a x^2 + b x + c} + \paren {b x + 2 c} \sqrt {a x^2 + b x + c} } } {x^2}       | c =  }} {{eqn | r = \paren {a x^2 + b x + c}^{-\frac 1 2} \frac {\paren {\sqrt c \paren {2 a x^2 + b x - 2 a x^2 - 2 b x - 2 c} + b x \sqrt {a x^2 + b x + c} } - \paren {\paren {b x + 2 c} \sqrt {a x^2 + b x + c} } } {x^2}       | c =  }} {{eqn | r = \paren {a x^2 + b x + c}^{-\frac 1 2} \frac {\paren {\sqrt c \paren {-b x - 2 c} - \paren {\paren {2 c} \sqrt {a x^2 + b x + c} } } } {x^2}       | c =  }} {{eqn | r = -\frac {2 c + \sqrt c \paren {b x + 2 c} \paren {a x^2 + b x + c}^{-\frac 1 2} } {x^2}       | c =  }} {{eqn | r = \sqrt c \times D       | c =  }} {{end-eqn}} Now provided $N$ is real and non zero: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {x \sqrt {a x^2 + b x + c} }       | r = \int \frac D N \rd x       | c =  }} {{eqn | r = \frac {-1} {\sqrt c} \int \frac {\frac {\d N} {\d x} } N \rd x       | c =  }} {{eqn | r = \frac {-1} {\sqrt c} \ln \size N       | c = Primitive of Function under its Derivative }} {{eqn | r = \frac {-1} {\sqrt c} \ln \size {\frac {\paren {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} } x}       | c =  }} {{end-eqn}}
{{begin-eqn}} {{eqn | l = x       | r = \frac 1 u       | c =  }} {{eqn | ll= \implies       | l = \frac {\d x} {\d u}       | r = \frac {-1} {u^2}       | c = Primitive of Power }} {{eqn | ll= \implies       | l = \int \frac {\d x} {x \sqrt {a x^2 + b x + c} }       | r = \int {\frac 1 {\frac 1 u \sqrt {a \left({\frac 1 u}\right)^2 + b \left({\frac 1 u}\right) + c} } } \frac {-\rd u}{u^2}       | c = Integration by Substitution }} {{eqn | r = -\int \frac {\d u} {\frac {u^2} u \sqrt {\frac 1 {u^2} \left({a + b u + c u^2}\right) } }       | c = Primitive of Constant Multiple of Function }} {{eqn | r = -\int \frac {\d u} {\frac {u^2} u \sqrt {\frac 1 {u^2} } \sqrt {a + b u + c u^2} }       | c = extracting $\sqrt {\frac 1 {u^2} }$ }} {{eqn | r = -\int \frac {\d u} {\sqrt {a + b u + c u^2} }       | c = those $u$ factors all cancel }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \frac {\d u} {\sqrt {a + b u + c u^2} }       | r = \begin{cases} \dfrac {-1} {\sqrt c} \ln \left({2 \sqrt c \sqrt {a + b u + c u^2} + 2 c u + b}\right) + C & : b^2 - 4 a c > 0 \\ \dfrac {-1} {\sqrt c} \sinh^{-1} \left({\dfrac {2 c u + b} {\sqrt{4 a c - b^2} } }\right) + C & : b^2 - 4 a c < 0 \\ \dfrac {-1} {\sqrt c} \ln \left\vert{2 c u + b}\right\vert + C & : b^2 - 4 a c = 0 \end{cases}       | c = Primitive of $\dfrac 1 {\sqrt {a x^2 + b x + c} }$ }} {{eqn | ll= \implies       | l = \int \frac {\d x} {x \sqrt {a x^2 + b x + c} }       | r = \begin{cases} \dfrac {-1} {\sqrt c} \ln \left({2 \sqrt c \sqrt {a + b \left({\frac 1 x}\right) + c \left({\frac 1 x}\right)^2} + 2 c \left({\frac 1 x}\right) + b}\right) + C & : b^2 - 4 a c > 0 \\ \dfrac {-1} {\sqrt c} \sinh^{-1} \left({\dfrac {2 c \left({\frac 1 x}\right) + b} {\sqrt{4 a c - b^2} } }\right) + C & : b^2 - 4 a c < 0 \\ \dfrac {-1} {\sqrt c} \ln \left\vert{2 c \left({\frac 1 x}\right) + b}\right\vert + C & : b^2 - 4 a c = 0 \end{cases}       | c = substituting for $u$ }} {{eqn | r = \begin{cases} \dfrac {-1} {\sqrt c} \ln \left({2 \sqrt c \sqrt {\dfrac {a x^2 + b x + c} {x^2} } + \dfrac {b x + 2 c} x}\right) + C & : b^2 - 4 a c > 0 \\ \dfrac {-1} {\sqrt c} \sinh^{-1} \left({\dfrac {b x + 2 c} {x \sqrt{4 a c - b^2} } }\right) + C & : b^2 - 4 a c < 0 \\ \dfrac {-1} {\sqrt c} \ln \left\vert{\dfrac {2 c} x + b}\right\vert + C & : b^2 - 4 a c = 0 \end{cases}       | c = simplifying }} {{eqn | r = \begin{cases} \dfrac {-1} {\sqrt c} \ln \left({\dfrac {2 \sqrt c \sqrt {a x^2 + b x + c} + b x + 2 c} x}\right) + C & : b^2 - 4 a c > 0 \\ \dfrac {-1} {\sqrt c} \sinh^{-1} \left({\dfrac {b x + 2 c} {\left\vert{x}\right\vert \sqrt{4 a c - b^2} } }\right) + C & : b^2 - 4 a c < 0 \\ \dfrac {-1} {\sqrt c} \ln \left\vert{\dfrac {2 c} x + b}\right\vert + C & : b^2 - 4 a c = 0 \end{cases}       | c =  }} {{end-eqn}} {{explain|where does that $\left\vert{x}\right\vert$ come from in the $\sinh^{-1}$ expression?}} Hence the result. {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {\sin a x + \cos a x}       | r = \frac 1 a \int \frac {\dfrac {2 \rd u} {1 + u^2} } {\dfrac {2 u} {1 + u^2} + \dfrac {1 - u^2} {1 + u^2} }       | c = Weierstrass Substitution: $u = \tan \dfrac {a x} 2$ }} {{eqn | r = \frac 2 a \int \frac {\d u} {- u^2 + 2 u + 1}       | c = simplifying }} {{eqn | r = \frac 2 a \paren {\frac 1 {\sqrt 8} \ln \size {\frac {-2 u + 2 - \sqrt 8} {-2 u + 2 + \sqrt 8} } } + C       | c = Primitive of $\dfrac 1 {a x^2 + b x + c}$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\frac {u - 1 + \sqrt 2} {u - 1 - \sqrt 2} } + C       | c = simplifying }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\frac {\tan \dfrac {a x} 2 - \paren {1 - \sqrt 2} } {\tan \dfrac {a x} 2 - \paren {1 + \sqrt 2} } } + C       | c = substituting for $u$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\frac {\tan \dfrac {a x} 2 - \tan \dfrac \pi 8} {\tan \dfrac {a x} 2 - \tan \dfrac {3 \pi} 8} } + C       | c = Tangent of $\dfrac \pi 8$ and Tangent of $\dfrac {3 \pi} 8$ }} {{end-eqn}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {\sin a x + \cos a x}       | r = \int \frac {\d x} {\sqrt 2 \map \cos {a x - \dfrac \pi 4} }       | c = Sine of x plus Cosine of x: Cosine Form }} {{eqn | r = \frac 1 {\sqrt 2} \int \map \sec {a x - \dfrac \pi 4} \rd x       | c = Secant is Reciprocal of Cosine }} {{end-eqn}} Let: {{begin-eqn}} {{eqn | l = z       | r = a x - \dfrac \pi 4       | c =  }} {{eqn | ll= \leadsto       | l = \frac {\d z} {\d x}       | r = a       | c = Derivative of Identity Function <br/>and Derivatives of Function of $a x + b$ }} {{eqn | ll= \leadsto       | l = \frac 1 {\sqrt 2} \int \map \sec {a x - \dfrac \pi 4} \rd x       | r = \frac 1 {a \sqrt 2} \int \sec z \rd z       | c = Integration by Substitution }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\map \tan {\frac z 2 + \frac \pi 4} } + C       | c = Primitive of $\sec a x$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\map \tan {\frac 1 2 \paren {a x - \dfrac \pi 4} + \frac \pi 4} } + C       | c = substituting for $z$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \size {\map \tan {\frac {a x} 2 + \frac \pi 8} } + C       | c = simplifying }} {{end-eqn}} {{qed}}
Let $z = a x + \arctan \dfrac {-p} q$. Then: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {p \sin a x + q \cos a x + r}       | r = \int \frac {\d x} {r + \sqrt {p^2 + q^2} \map \cos {a x + \arctan \dfrac {-p} q} }       | c = Multiple of Sine plus Multiple of Cosine }} {{eqn | r = \frac 1 a \int \frac {\d z} {r + \sqrt {p^2 + q^2} \cos z}       | c = Primitive of Function of $a x + b$ }} {{end-eqn}} Let $d = \sqrt {p^2 + q^2}$. Then: {{begin-eqn}} {{eqn | r = \int \frac {\d x} {p \sin a x + q \cos a x + r}       | o =        | c =  }} {{eqn | r = \frac 1 a \int \frac {\d z} {r + d \cos z}       | c =  }} {{eqn | r = \frac 1 a \begin{cases}  \ds \frac 2 {\sqrt {r^2 - d^2} } \map \arctan {\sqrt {\frac {r + d} {r - d} } \tan \dfrac z 2} + C & : r^2 > d^2 \\ \ds \frac 1 {\sqrt {d^2 - r^2} } \ln \size {\frac {\tan \dfrac z 2 + \sqrt {\dfrac {d - r} {d + r} } } {\tan \dfrac z 2 - \sqrt {\dfrac {d - r} {d + r} } } } + C & : r^2 < d^2 \\ \end{cases}       | c = Primitive of $\dfrac 1 {p + q \cos a x}$ }} {{eqn | r = \begin{cases}  \ds \frac 2 {a \sqrt {r^2 - p^2 - q^2} } \map \arctan {\sqrt {\frac {r + d} {r - d} } \tan \dfrac z 2} + C & : r^2 > p^2 + q^2 \\ \ds \frac 1 {a \sqrt {p^2 + q^2 - r^2} } \ln \size {\frac {\tan \dfrac z 2 + \sqrt {\dfrac {d - r} {d + r} } } {\tan \dfrac z 2 - \sqrt {\dfrac {d - r} {d + r} } } } + C & : r^2 < p^2 + q^2 \\ \end{cases}       | c = partly substituting for $d$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \sqrt {\frac {r + d} {r - d} } \tan \frac z 2       | r = \sqrt {\frac {r + \sqrt {p^2 + q^2} } {r - \sqrt {p^2 - q^2} } } \tan \frac z 2       | c = substituting for $d$ }} {{eqn | r = \sqrt {\frac {\paren {r + \sqrt {p^2 + q^2} }^2} {\paren {r - \sqrt {p^2 + q^2} } \paren {r + \sqrt {p^2 + q^2} } } } \tan \frac z 2       | c = multiplying top and bottom by $r + \sqrt {p^2 + q^2}$ }} {{eqn | r = \frac {r + \sqrt {p^2 + q^2} } {\sqrt {r^2 - p^2 - q^2} } \tan \frac z 2       | c = Difference of Two Squares }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \tan \frac z 2       | r = \map \tan {\frac {a x} 2 + \frac 1 2 \arctan \frac {-p} q}       | c = substituting for $z$ }} {{eqn | r = \frac {\tan \dfrac {a x} 2 + \map \tan {\frac 1 2 \arctan \frac {-p} q} } {1 - \tan \dfrac {a x} 2 \map \tan {\frac 1 2 \arctan \frac {-p} q} }       | c = Tangent of Sum }} {{end-eqn}}
Let $z = a x + \arctan \dfrac q p$. Then: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {p \sin a x + q \cos a x + r}       | r = \int \frac {\d x} {r + \sqrt {p^2 + q^2} \map \sin {a x + \arctan \dfrac q p} }       | c = Multiple of Sine plus Multiple of Cosine }} {{eqn | r = \frac 1 a \int \frac {\d z} {r + \sqrt {p^2 + q^2} \sin z}       | c = Primitive of Function of $a x + b$ }} {{end-eqn}} Let $d = \sqrt {p^2 + q^2}$. Then: {{begin-eqn}} {{eqn | r = \int \frac {\d x} {p \sin a x + q \cos a x + r}       | o =        | c =  }} {{eqn | r = \frac 1 a \int \frac {\d z} {r + d \sin z}       | c =  }} {{eqn | r = \frac 1 a \begin{cases}  \ds \frac 2 {\sqrt {r^2 - d^2} } \map \arctan {\frac {r \tan \dfrac z 2 + d} {\sqrt {r^2 - d^2} } } + C & : d^2 - r^2 < 0 \\ \ds \frac 1 {\sqrt {d^2 - r^2} } \ln \size {\frac {r \tan \dfrac z 2 + d - \sqrt {r^2 - d^2} } {r \tan \dfrac z 2 + d + \sqrt {r^2 - d^2} } } + C & : r^2 - d^2 > 0 \\ \end{cases}       | c = Primitive of $\dfrac 1 {p + q \sin a x}$ }} {{eqn | r = \begin{cases}  \ds \frac 2 {a \sqrt {r^2 - p^2 - q^2} } \map \arctan {\frac {r \tan \dfrac z 2 + \sqrt {p^2 + q^2} } {\sqrt {r^2 - p^2 - q^2} } } + C & : r^2 > p^2 + q^2 \\ \ds \frac 1 {a \sqrt {p^2 + q^2 - r^2} } \ln \size {\frac {r \tan \dfrac z 2 + \sqrt {p^2 + q^2} - \sqrt {r^2 - p^2 - q^2} } {r \tan \dfrac z 2 + \sqrt {p^2 + q^2} + \sqrt {r^2 - p^2 - q^2} } } + C & : r^2 < p^2 + q^2 \\ \end{cases}       | c = substituting for $d$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \tan \frac z 2       | r = \map \tan {\frac {a x} 2 + \frac 1 2 \arctan \frac q p}       | c = substituting for $z$ }} {{eqn | r = \frac {\tan \dfrac {a x} 2 + \map \tan {\frac 1 2 \arctan \frac q p} } {1 - \tan \dfrac {a x} 2 \map \tan {\frac 1 2 \arctan \frac q p} }       | c = Tangent of Sum }} {{end-eqn}} Now let: {{begin-eqn}} {{eqn | l = y       | r = \map \tan {\frac 1 2 \arctan \frac q p}       | c =  }} {{eqn | ll= \leadsto       | l = \arctan y       | r = \frac 1 2 \arctan \frac q p       | c =  }} {{eqn | ll= \leadsto       | l = 2 \arctan y       | r = \arctan \frac q p       | c =  }} {{eqn | ll= \leadsto       | l = \map \tan {2 \arctan y}       | r = \frac q p       | c =  }} {{eqn | ll= \leadsto       | l = \frac {2 \map \tan {\arctan y} } {1 - \map {\tan^2} {\arctan y} }       | r = \frac q p       | c = Double Angle Formula for Tangent }} {{eqn | ll= \leadsto       | l = \frac {2 y} {1 - y^2}       | r = \frac q p       | c = {{Defof|Arctangent}} }} {{eqn | ll= \leadsto       | l = q y^2 + 2 p y - q       | r = 0       | c = rearranging }} {{eqn | ll= \leadsto       | l = y       | r = \frac {-2 p \pm \sqrt{4 p^2 + 4 q ^2} } {2 q}       | c = Quadratic Formula }} {{eqn | r = \frac {-p \pm \sqrt{p^2 + q^2} } q       | c = simplifying }} {{end-eqn}} Hence: {{begin-eqn}} {{eqn | l = \tan \frac z 2       | r = \frac {\tan \dfrac {a x} 2 + \dfrac {-p \pm \sqrt{p^2 + q^2} } q} {1 - \tan \dfrac {a x} 2 \paren {\dfrac {-p \pm \sqrt{p^2 + q^2} } q} }       | c = Tangent of Sum }} {{eqn| r = \frac {q \tan \dfrac {a x} 2 - p \pm \sqrt{p^2 + q^2} } {q - \tan \dfrac {a x} 2 \paren {-p \pm \sqrt{p^2 + q^2} } }       | c =  }} {{end-eqn}}
{{begin-eqn}} {{eqn | l = \int \frac {\d x} {p + q \cos a x}       | r = \frac 2 {a \paren {p - q} } \int \frac {\d u} {u^2 + \dfrac {p + q} {p - q} }       | c = Weierstrass Substitution: $u = \tan \dfrac {a x} 2$ }} {{end-eqn}} Let $p^2 > q^2$. Then, by Sign of Quotient of Factors of Difference of Squares: :$\dfrac {p + q} {p - q} > 0$ Thus, let $\dfrac {p + q} {p - q} = d^2$. Then: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {p + q \cos a x}       | r = \frac 2 {a \paren {p - q} } \int \frac {\d u} {u^2 + d^2}       | c =  }} {{eqn | r = \frac 2 {a \paren {p - q} } \frac 1 d \arctan \frac u d + C       | c = Primitive of $\dfrac 1 {x^2 + a^2}$ }} {{eqn | r = \frac 2 {a \paren {p - q} } \frac 1 {\sqrt {\dfrac {p + q} {p - q} } } \map \arctan {\frac {\tan \dfrac {a x} 2} {\sqrt {\dfrac {p + q} {p - q} } } } + C       | c = substituting for $u$ and $d$ }} {{eqn | r = \frac 2 {a \sqrt {p^2 - q^2} } \map \arctan {\sqrt {\frac {p - q} {p + q} } \tan \dfrac {a x} 2} + C       | c = simplifying }} {{end-eqn}} {{qed|lemma}} Now let $p^2 < q^2$. Then, by Sign of Quotient of Factors of Difference of Squares: :$\dfrac {p + q} {p - q} < 0$ Thus, let: :$-\dfrac {p + q} {p - q} = d^2$ or: :$\dfrac {q + p} {q - p} = d^2$ Then: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {p + q \cos a x}       | r = \frac 2 {a \paren {p - q} } \int \frac {\d u} {u^2 - d^2}       | c =  }} {{eqn | r = \frac 2 {a \paren {p - q} } \frac 1 {2 d} \ln \size {\frac {u - d} {u + d} } + C       | c = Primitive of $\dfrac 1 {x^2 - a^2}$ }} {{eqn | r = \frac 1 {a \paren {p - q} } \frac 1 {\sqrt {\dfrac {q + p} {q - p} } } \ln \size {\frac {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q + p} {q - p} } } {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q + p} {q - p} } } } + C       | c = substituting for $u$ and $d$ }} {{eqn | r = \frac 1 {a \sqrt {q^2 - p^2} } \ln \size {\frac {\tan \dfrac {a x} 2 - \sqrt {\dfrac {q + p} {q - p} } } {\tan \dfrac {a x} 2 + \sqrt {\dfrac {q + p} {q - p} } } } + C       | c = simplifying }} {{end-eqn}} {{qed}}
Let $u = p^2 + q^2$ and $v = q^2 - p^2$. Then: {{begin-eqn}} {{eqn | n = 1       | l = u + v       | r = 2 q^2 }} {{eqn | n = 2       | l = u - v       | r = 2 p ^2 }} {{end-eqn}} Also: {{begin-eqn}} {{eqn | l = u^2 - v^2       | r = \paren {u + v} \paren {u - v} }} {{eqn | l = u^2 - v^2       | r = \paren {2 q^2} \paren {2 p^2}       | c = from $\paren 1$ and $\paren 2$ }} {{eqn | n = 3       | l = u^2 - v^2       | r = 4 p^2 q^2 }} {{end-eqn}} Therefore: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {p^2 \sin^2 a x + q^2 \cos^2 a x}       | r = \int \frac {\d x} {p^2 \paren {\frac {1 - \cos 2 a x} 2} + q^2 \cos^2 a x}       | c = Square of Sine }} {{eqn | r = \int \frac {\d x} {p^2 \paren {\frac {1 - \cos 2 a x} 2} + q^2 \paren {\frac {1 + \cos 2 a x} 2} }       | c = Square of Cosine }} {{eqn | r = \int \frac {2 \d x} {p^2 - p^2 \cos 2 a x + q^2 + q^2 \cos 2 a x}       | c =  }} {{eqn | r = \int \frac {2 \d x} {p^2 + q^2 + \paren {q^2 - p^2} \cos 2 a x}       | c =  }} {{eqn | r = 2 \paren { \frac 2 {\paren {2 a} \sqrt{u^2 - v^2} } } \map \arctan {\sqrt{ \frac {u - v} {u + v} } \tan \frac {\paren {2 a} x} 2} + C       | c = Primitive of $\dfrac 1 {p + q \cos a x}$ }} {{eqn | r = 2 \paren {\frac 1 {a \sqrt{4 p^2 q^2} } } \map \arctan {\sqrt{ \frac {2 p^2} {2 q^2} } \tan a x} + C       | c = from $\paren 3$ }} {{eqn | r = \paren {\frac 2 {2 a p q} } \map \arctan {\sqrt{ \frac {p^2} {q^2} } \tan a x} + C       | c =  }} {{eqn | r = \paren {\frac 1 {a p q} } \map \arctan {\frac p q \tan a x} + C       | c =  }} {{eqn | r = \frac 1 {a p q} \map \arctan {\frac {p \tan a x} q} + C       | c =  }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn	| l = \int \frac {\d x} {p^2 \sin^2 a x + q^2 \cos^2 a x} 	| r = \int \frac {\sec^2 a x \d x} {p^2 \tan^2 a x + q^2} 	| c = multiplying by $\dfrac {\sec^2 a x} {\sec^2 a x}$ }} {{eqn	| r = \frac 1 a \int \frac {\d t} {p^2 t^2 + q^2} 	| c = substituting $t = \tan a x$ }} {{eqn	| r = \frac 1 {a p^2} \int \frac {\d t} {t^2 + \paren {\frac q p}^2} }} {{eqn	| r = \frac 1 {a p^2} \times \frac p q \map \arctan {\frac {p t} q} + C 	| c = Primitive of $\dfrac 1 {x^2 + a^2}$ }} {{eqn	| r = \frac 1 {a p q} \map \arctan {\frac {p \tan a x} q} + C 	| c = substituting back for $t$ }} {{end-eqn}} {{qed}}
From Primitive of $\dfrac {1 + x^2} {1 + x^4}$, we have: :$\displaystyle \int \frac {x^2 + 1} {x^4 + 1} \rd x = \frac 1 {\sqrt 2} \map \arctan {\frac 1 {\sqrt 2} \paren {x - \frac 1 x} } + C$ From Primitive of $\dfrac {-1 + x^2} {1 + x^4}$, we have: :$\displaystyle \int \frac {x^2 - 1} {x^4 + 1} \rd x = \frac 1 {2 \sqrt 2} \ln \size {\frac {x^2 - \sqrt 2 x + 1} {x^2 + \sqrt 2 x + 1} } + C$ We therefore have:  {{begin-eqn}} {{eqn	| l = \int \frac 1 {1 + x^4} \rd x 	| r = \frac 1 2 \int \frac {x^2 + 1 - \paren {x^2 - 1} } {1 + x^4} \rd x }} {{eqn	| r = \frac 1 2 \paren {\int \frac {x^2 + 1} {x^4 + 1} \rd x - \int \frac {x^2 - 1} {x^4 + 1} \rd x} }} {{eqn	| r = \frac 1 {2 \sqrt 2} \paren {\map \arctan {\frac 1 {\sqrt 2} \paren {x - \frac 1 x} } - \frac 1 2 \ln \size {\frac {x^2 - \sqrt 2 x + 1} {x^2 + \sqrt 2 x + 1} } } + C }} {{eqn	| r = \frac 1 {2 \sqrt 2} \paren {\map \arctan {\frac 1 {\sqrt 2} \paren {x - \frac 1 x} } + \frac 1 2 \ln \size {\frac {x^2 + \sqrt 2 x + 1} {x^2 - \sqrt 2 x + 1} } } + C 	| c = Logarithm of Reciprocal }} {{end-eqn}} {{qed}}