hcju/proofwikiqa huggingface dataset:
Let: {{begin-eqn}} {{eqn | l = u       | r = \cos a x       | c =  }} {{eqn | l = \frac {\d u} {\d x}       | r = -a \sin a x       | c = Derivative of $\cos a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \frac {\d x} {\sin a x \paren {1 + \cos a x} }       | r = \int \frac {\sin a x \rd x} {\sin^2 a x \paren {1 + \cos a x} }       | c = multiplying top and bottom by $\sin a x$ }} {{eqn | r = \int \frac {\sin a x \rd x} {\paren {1 - \cos^2 a x} \paren {1 + \cos a x} }       | c = Sum of Squares of Sine and Cosine }} {{eqn | r = \frac {-1} a \int \frac {\d u} {\paren {1 - u^2} \paren {1 + u} }       | c = Integration by Substitution }} {{eqn | r = \frac {-1} a \int \frac {\d u} {\paren {1 - u} \paren {1 + u}^2}       | c = Difference of Two Squares }} {{eqn | r = \frac {-1} a \paren {\frac 1 {-2} \paren {\frac 1 {1 + u} + \frac {-1} {-2} \ln \size {\frac {1 - u} {1 + u} } } } + C       | c = Primitive of $\dfrac 1 {\paren {a x + b}^2 \paren {p x + q} }$ }} {{eqn | r = \frac 1 {2 a \paren {1 + u} } + \frac 1 {4 a} \ln \size {\frac {1 - u} {1 + u} } + C       | c = simplifying }} {{eqn | r = \frac 1 {2 a \paren {1 + \cos a x} } + \frac 1 {4 a} \ln \size {\frac {1 - \cos a x} {1 + \cos a x} } + C       | c = substituting for $u$ }} {{eqn | r = \frac 1 {2 a \paren {1 + \cos a x} } + \frac 1 {4 a} \ln \size {\frac {\frac 1 2 \sec^2 \frac {a x} 2} {\frac 1 2 \csc^2 \frac {a x} 2} } + C       | c = Reciprocal of $1 - \cos$ and Reciprocal of $1 + \cos$ }} {{eqn | r = \frac 1 {2 a \paren {1 + \cos a x} } + \frac 1 {4 a} \ln \size {\frac {\sin^2 \frac {a x} 2} {\cos^2 \frac {a x} 2} } + C       | c = Secant is Reciprocal of Cosine }} {{eqn | r = \frac 1 {2 a \paren {1 + \cos a x} } + \frac 1 {4 a} \ln \size {\tan^2 \frac {a x} 2} + C       | c = Tangent is Sine divided by Cosine }} {{eqn | r = \frac 1 {2 a \paren {1 + \cos a x} } + \frac 1 {2 a} \ln \size {\tan \frac {a x} 2} + C       | c = Logarithm of Power }} {{end-eqn}} {{qed}}
Let: {{begin-eqn}} {{eqn | l = u       | r = \cos a x       | c =  }} {{eqn | l = \frac {\mathrm d u} {\mathrm d x}       | r = -a \sin a x       | c = Derivative of $\cos a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {\sin a x \left({1 - \cos a x}\right)}       | r = \int \frac {\sin a x \ \mathrm d x} {\sin^2 a x \left({1 - \cos a x}\right)}       | c = multiplying top and bottom by $\sin a x$ }} {{eqn | r = \int \frac {\sin a x \ \mathrm d x} {\left({1 - \cos^2 a x}\right) \left({1 - \cos a x}\right)}       | c = Sum of Squares of Sine and Cosine }} {{eqn | r = \frac {-1} a \int \frac {\mathrm d u} {\left({1 - u^2}\right) \left({1 - u}\right)}       | c = Integration by Substitution }} {{eqn | r = \frac {-1} a \int \frac {\mathrm d u} {\left({1 + u}\right) \left({1 - u}\right)^2}       | c = Difference of Two Squares }} {{eqn | r = \frac {-1} a \left({\frac 1 2 \left({\frac 1 {1 - u} + \frac 1 2 \ln \left\vert{\frac {1 + u} {1 - u} }\right\vert}\right)}\right) + C       | c = Primitive of $\dfrac 1 {\left({a x + b}\right)^2 \left({p x + q}\right)}$ }} {{eqn | r = \frac {-1} {2 a \left({1 - u}\right)} - \frac 1 {4 a} \ln \left\vert{\frac {1 + u} {1 - u} }\right\vert + C       | c = simplifying }} {{eqn | r = \frac {-1} {2 a \left({1 - u}\right)} + \frac 1 {4 a} \ln \left\vert{\frac {1 - u} {1 + u} }\right\vert + C       | c = Logarithm of Power }} {{eqn | r = \frac {-1} {2 a \left({1 - \cos a x}\right)} + \frac 1 {4 a} \ln \left\vert{\frac {1 - \cos a x} {1 + \cos a x} }\right\vert + C       | c = substituting for $u$ }} {{eqn | r = \frac {-1} {2 a \left({1 - \cos a x}\right)} + \frac 1 {4 a} \ln \left\vert{\frac {\frac 1 2 \sec^2 \frac {a x} 2} {\frac 1 2 \csc^2 \frac {a x} 2} }\right\vert + C       | c = Reciprocal of $1 - \cos$ and Reciprocal of $1 + \cos$ }} {{eqn | r = \frac {-1} {2 a \left({1 - \cos a x}\right)} + \frac 1 {4 a} \ln \left\vert{\frac {\sin^2 \frac {a x} 2} {\cos^2 \frac {a x} 2} }\right\vert + C       | c = Secant is Reciprocal of Cosine }} {{eqn | r = \frac {-1} {2 a \left({1 - \cos a x}\right)} + \frac 1 {4 a} \ln \left\vert{\tan^2 \frac {a x} 2}\right\vert + C       | c = Tangent is Sine divided by Cosine }} {{eqn | r = \frac {-1} {2 a \left({1 - \cos a x}\right)} + \frac 1 {2 a} \ln \left\vert{\tan \frac {a x} 2}\right\vert + C       | c = Logarithm of Power }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {\sin a x - \cos a x}       | r = \int \frac {\mathrm d x} {\sqrt 2 \cos \left({a x - \dfrac {3 \pi} 4}\right)}       | c = Sine of x minus Cosine of x: Cosine Form }} {{eqn | r = \frac 1 {\sqrt 2} \int \sec \left({a x - \dfrac {3 \pi} 4}\right) \ \mathrm d x       | c = Secant is Reciprocal of Cosine }} {{end-eqn}} Let: {{begin-eqn}} {{eqn | l = z       | r = a x - \dfrac {3 \pi} 4       | c =  }} {{eqn | ll= \implies       | l = \frac {\mathrm d z} {\mathrm d x}       | r = a       | c = Derivative of Identity Function <br/>and Derivatives of Function of $a x + b$ }} {{eqn | ll= \implies       | l = \frac 1 {\sqrt 2} \int \sec \left({a x - \dfrac {3 \pi} 4}\right) \ \mathrm d x       | r = \frac 1 {a \sqrt 2} \int \sec z \ \mathrm d z       | c = Integration by Substitution }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \left\vert{\tan \left({\frac z 2 + \frac \pi 4}\right)}\right\vert + C       | c = Primitive of $\sec a x$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \left\vert{\tan \left({\frac 1 2 \left({a x - \dfrac {3 \pi} 4}\right) + \frac \pi 4}\right)}\right\vert + C       | c = substituting for $z$ }} {{eqn | r = \frac 1 {a \sqrt 2} \ln \left\vert{\tan \left({\frac {a x} 2 - \frac \pi 8}\right)}\right\vert + C       | c = simplifying }} {{end-eqn}} {{qed}}
First note that: {{begin-eqn}} {{eqn | n = 1       | l = \frac {\mathrm d} {\mathrm d x} \left({\sin a x + \cos a x}\right)       | r = a \left({\cos a x - \sin a x}\right)       | c = Derivative of $\sin a x$ and Derivative of $\cos a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \frac {\sin a x \ \mathrm d x} {\sin a x + \cos a x}       | r = \int \frac {\left({\sin a x + \cos a x - \cos a x}\right) \ \mathrm d x} {\sin a x + \cos a x}       | c =  }} {{eqn | r = \int \frac {\left({\sin a x + \cos a x}\right) \ \mathrm d x} {\sin a x + \cos a x} - \int \frac {\cos a x \ \mathrm d x} {\sin a x + \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = \int \mathrm d x - \int \frac {\cos a x \ \mathrm d x} {\sin a x + \cos a x}       | c = simplification }} {{eqn | r = \int \mathrm d x - \int \frac {\left({\cos a x - \sin a x + \sin a x}\right) \ \mathrm d x} {\sin a x + \cos a x}       | c =  }} {{eqn | r = \int \mathrm d x - \int \frac {\left({\cos a x - \sin a x}\right) \ \mathrm d x} {\sin a x + \cos a x} - \int \frac {\sin a x \ \mathrm d x} {\sin a x + \cos a x}       | c = Linear Combination of Integrals }} {{eqn | ll= \implies       | l = 2 \int \frac {\sin a x \ \mathrm d x} {\sin a x + \cos a x}       | r = \int \mathrm d x - \int \frac {\left({\cos a x - \sin a x}\right) \ \mathrm d x} {\sin a x + \cos a x}       | c = rearranging }} {{eqn | ll= \implies       | l = \int \frac {\sin a x \ \mathrm d x} {\sin a x + \cos a x}       | r = \frac 1 2 \int \mathrm d x - \frac 1 {2 a} \int \frac {a \left({\cos a x - \sin a x}\right) \ \mathrm d x} {\sin a x + \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = \frac x 2 - \frac 1 {2 a} \int \frac {a \left({\cos a x - \sin a x}\right) \ \mathrm d x} {\sin a x + \cos a x} + C       | c = Primitive of Constant }} {{Eqn-intertext|Then from $(1)$:}} {{eqn | r = \frac x 2 - \frac 1 {2 a} \ln \left\vert{\sin a x + \cos a x}\right\vert + C       | c = Primitive of Function under its Derivative }} {{end-eqn}} {{qed}}
First note that: {{begin-eqn}} {{eqn | n = 1       | l = \map {\frac {\d} {\d x} } {\sin a x - \cos a x}       | r = a \paren {\cos a x + \sin a x}       | c = Derivative of $\sin a x$ and Derivative of $\cos a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \frac {\sin a x \rd x} {\sin a x - \cos a x}       | r = \int \frac {\paren {\sin a x - \cos a x + \cos a x} \rd x} {\sin a x - \cos a x}       | c =  }} {{eqn | r = \int \frac {\paren {\sin a x - \cos a x} \rd x} {\sin a x - \cos a x} + \int \frac {\cos a x \rd x} {\sin a x - \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = \int \rd x + \int \frac {\cos a x \rd x} {\sin a x - \cos a x}       | c = simplification }} {{eqn | r = \int \rd x + \int \frac {\paren {\cos a x + \sin a x - \sin a x} \rd x} {\sin a x - \cos a x}       | c =  }} {{eqn | r = \int \rd x + \int \frac {\paren {\cos a x + \sin a x} \rd x} {\sin a x - \cos a x} - \int \frac {\sin a x \rd x} {\sin a x - \cos a x}       | c = Linear Combination of Integrals }} {{eqn | ll= \leadsto       | l = 2 \int \frac {\sin a x \rd x} {\sin a x - \cos a x}       | r = \int \rd x + \int \frac {\paren {\cos a x + \sin a x} \rd x} {\sin a x - \cos a x}       | c = rearranging }} {{eqn | ll= \leadsto       | l = \int \frac {\sin a x \rd x} {\sin a x + \cos a x}       | r = \frac 1 2 \int \rd x + \frac 1 {2 a} \int \frac {a \paren {\cos a x + \sin a x} \rd x} {\sin a x - \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = \frac x 2 + \frac 1 {2 a} \int \frac {a \paren {\cos a x + \sin a x} \rd x} {\sin a x - \cos a x} + C       | c = Primitive of Constant }} {{Eqn-intertext|Then from $(1)$:}} {{eqn | r = \frac x 2 + \frac 1 {2 a} \ln \size {\sin a x - \cos a x} + C       | c = Primitive of Function under its Derivative }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\cos a x \rd x} {\sin a x + \cos a x}       | r = \int \frac {\paren {\sin a x + \cos a x - \sin a x} \rd x} {\sin a x + \cos a x}       | c =  }} {{eqn | r = \int \frac {\paren {\sin a x + \cos a x} \rd x} {\sin a x + \cos a x} - \int \frac {\sin a x \rd x} {\sin a x + \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = \int \rd x - \int \frac {\sin a x \rd x} {\sin a x + \cos a x}       | c = simplification }} {{eqn | r = x - \int \frac {\sin a x \rd x} {\sin a x + \cos a x} + C       | c = Primitive of Constant }} {{eqn | r = x - \paren {\frac x 2 - \frac 1 {2 a} \ln \size {\sin a x + \cos a x} } + C       | c = Primitive of $\dfrac {\sin a x} {\sin a x + \cos a x}$ }} {{eqn | r = \frac x 2 + \frac 1 {2 a} \ln \size {\sin a x + \cos a x} + C       | c = simplifying }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\cos a x \ \mathrm d x} {\sin a x - \cos a x}       | r = \int \frac {\left({\cos a x - \sin a x + \sin a x}\right) \ \mathrm d x} {\sin a x - \cos a x}       | c =  }} {{eqn | r = -\int \frac {\left({\sin a x - \cos a x}\right) \ \mathrm d x} {\sin a x - \cos a x} + \int \frac {\sin a x \ \mathrm d x} {\sin a x - \cos a x}       | c = Linear Combination of Integrals }} {{eqn | r = -\int \mathrm d x + \int \frac {\sin a x \ \mathrm d x} {\sin a x - \cos a x}       | c = simplification }} {{eqn | r = -x + \int \frac {\sin a x \ \mathrm d x} {\sin a x - \cos a x} + C       | c = Primitive of Constant }} {{eqn | r = - x + \left({\frac x 2 + \frac 1 {2 a} \ln \left\vert{\sin a x - \cos a x}\right\vert}\right) + C       | c = Primitive of $\dfrac {\sin a x} {\sin a x - \cos a x}$ }} {{eqn | r = \frac {-x} 2 + \frac 1 {2 a} \ln \left\vert{\sin a x - \cos a x}\right\vert + C       | c = simplifying }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \map {\frac \d {\d x} } {p + q \cos a x}       | r = -a q \sin a x       | c = Derivative of $\cos a x$ }} {{eqn | ll= \leadsto       | l = \int \frac {\sin a x \rd x} {p + q \cos a x}       | r = \frac {-1} {a q} \ln \size {p + q \cos a x} + C       | c = Primitive of Function under its Derivative }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \frac \d {\d x} \left({p + q \sin a x}\right)       | r = a q \cos a x       | c = Derivative of $\sin a x$ }} {{eqn | ll= \implies       | l = \int \frac {\cos a x \rd x} {p + q \sin a x}       | r = \frac 1 {a q} \ln \left\vert{p + q \sin a x}\right\vert + C       | c = Primitive of Function under its Derivative }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = z       | r = p + q \cos a x       | c =  }} {{eqn | ll= \implies       | l = \frac {\mathrm d z} {\mathrm d x}       | r = -a q \sin a x       | c = Derivative of $\cos a x$ }} {{eqn | ll= \implies       | l = \int \frac {\sin a x \ \mathrm d x} {\left({p + q \cos a x}\right)^n}       | r = \int \frac {\mathrm d z} {- a q z^n}       | c = Integration by Substitution }} {{eqn | r = \frac {-1} {a q} \int z^{-n} \ \mathrm d z       | c = Primitive of Constant Multiple of Function }} {{eqn | r = \frac {-1} {a q} \frac {z^{-n+1} } {-n + 1} + C       | c = Primitive of Power }} {{eqn | r = \frac 1 {a q \left({n - 1}\right) z^{n - 1} } + C       | c = simplifying }} {{eqn | r = \frac 1 {a q \left({n - 1}\right) \left({p + q \cos a x}\right)^{n - 1} } + C       | c = substituting for $z$ }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = z       | r = p + q \sin a x       | c =  }} {{eqn | ll= \implies       | l = \frac {\mathrm d z} {\mathrm d x}       | r = a q \sin a x       | c = Derivative of $\sin a x$ }} {{eqn | ll= \implies       | l = \int \frac {\cos a x \ \mathrm d x} {\left({p + q \sin a x}\right)^n}       | r = \int \frac {\mathrm d z} {a q z^n}       | c = Integration by Substitution }} {{eqn | r = \frac 1 {a q} \int z^{-n} \ \mathrm d z       | c = Primitive of Constant Multiple of Function }} {{eqn | r = \frac 1 {a q} \frac {z^{-n+1} } {-n + 1} + C       | c = Primitive of Power }} {{eqn | r = \frac {-1} {a q \left({n - 1}\right) z^{n - 1} } + C       | c = simplifying }} {{eqn | r = \frac {-1} {a q \left({n - 1}\right) \left({p + q \sin a x}\right)^{n - 1} } + C       | c = substituting for $z$ }} {{end-eqn}} {{qed}}
{{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {p \sin a x + q \cos a x}       | r = \int \frac {\mathrm d x} {\sqrt {p^2 + q^2} \cos \left({a x + \arctan \dfrac {-p} q}\right)}       | c = Multiple of Sine plus Multiple of Cosine }} {{eqn | r = \frac 1 {\sqrt {p^2 + q^2} } \int \sec \left({a x + \arctan \dfrac {-p} q}\right) \ \mathrm d x       | c = Secant is Reciprocal of Cosine }} {{eqn | r = \frac 1 {a \sqrt {p^2 + q^2} } \int \sec z \ \mathrm d z       | c = Primitive of Function of $a x + b$: $z = a x + \arctan \dfrac {-p} q$ }} {{eqn | r = \frac 1 {a \sqrt {p^2 + q^2} } \ln \tan \left\vert{\frac z 2 + \frac \pi 4}\right\vert + C       | c = Primitive of $\sec a x$ }} {{eqn | r = \frac 1 {a \sqrt {p^2 + q^2} } \ln \tan \left\vert{\frac 1 2 \left({a x + \arctan \dfrac {-p} q + \frac \pi 2}\right)}\right\vert + C       | c = substituting for $z$ }} {{eqn | r = \frac 1 {a \sqrt {p^2 + q^2} } \ln \tan \left\vert{\frac {a x + \arctan \dfrac q p} 2}\right\vert + C       | c = Lemma }} {{end-eqn}} {{qed}}
Let $z = a x + \arctan \dfrac {-p} q$. Then: {{begin-eqn}} {{eqn | l = \int \frac {\mathrm d x} {p \sin a x + q \left({1 + \cos a x}\right)}       | r = \int \frac {\mathrm d x} {q + \sqrt {p^2 + q^2} \cos \left({a x + \arctan \dfrac {-p} q}\right)}       | c = Multiple of Sine plus Multiple of Cosine }} {{eqn | r = \frac 1 a \int \frac {\mathrm d z} {q + \sqrt {p^2 + q^2} \cos z}       | c = Primitive of Function of $a x + b$ }} {{end-eqn}} Let $d = \sqrt {p^2 + q^2}$. We have that $q^2 < p^2 + q^2$ and so: {{begin-eqn}} {{eqn | r = \frac 1 a \int \frac {\mathrm d z} {q + \sqrt {p^2 + q^2} \cos z}       | o =        | c =  }} {{eqn | r = \frac 1 {a \sqrt {p^2 + q^2 - q^2} } \ln \left\vert{\frac {\tan \dfrac z 2 + \sqrt {\dfrac {\sqrt {p^2 + q^2} - q} {\sqrt {p^2 + q^2} + q} } } {\tan \dfrac z 2 - \sqrt {\dfrac {\sqrt {p^2 + q^2} - q} {\sqrt {p^2 + q^2} + q} } } }\right\vert + C       | c = Primitive of $\dfrac 1 {p + q \cos a x}$ }} {{eqn | r = \frac 1 {a p} \ln \left\vert{\frac {\tan \dfrac z 2 + \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} {\left({\sqrt {p^2 + q^2} + q}\right) \left({\sqrt {p^2 + q^2} - q}\right)} } } {\tan \dfrac z 2 - \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} {\left({\sqrt {p^2 + q^2} + q}\right) \left({\sqrt {p^2 + q^2} - q}\right)} } } }\right\vert + C       | c =  }} {{eqn | r = \frac 1 {a p} \ln \left\vert{\frac {\tan \dfrac z 2 + \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} {p^2 + q^2 - q^2} } } {\tan \dfrac z 2 - \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} {p^2 + q^2 - q^2} } } }\right\vert + C       | c = Difference of Two Squares }} {{eqn | r = \frac 1 {a p} \ln \left\vert{\frac {\tan \dfrac z 2 + \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} p} } {\tan \dfrac z 2 - \sqrt {\dfrac {\left({\sqrt {p^2 + q^2} - q}\right)^2} p} } }\right\vert + C       | c = simplifying }} {{eqn | r = \frac 1 {a p} \ln \left\vert{\frac {p \tan \dfrac z 2 + \sqrt {\left({\sqrt {p^2 + q^2} - q}\right)^2} } {p \tan \dfrac z 2 - \sqrt {\left({\sqrt {p^2 + q^2} - q}\right)^2} } }\right\vert + C       | c = simplifying }} {{end-eqn}} {{finish|Where to go from here?}} {{finish|Try putting the denominator into the form $p + q \sin z$ first, it may work out easier.}}
{{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} {p^2 \tan^2 a x - q^2} \rd x 	| c = multiplying by $\dfrac {\sec^2 a x} {\sec^2 a x}$ }} {{eqn	| r = \frac 1 a \int \frac 1 {p^2 t^2 - q^2} \rd t 	| c = substituting $t = \tan a x$ }} {{eqn	| r = \frac 1 {a p^2} \int \frac 1 {t^2 - \paren {\frac q p}^2} \rd t }} {{eqn	| r = \frac 1 {2 a \frac {p^2} p q} \ln \size {\frac {t - \frac q p} {t + \frac q p} } + C 	| c = Primitive of $\dfrac 1 {x^2 - a^2}$: Logarithm Form }} {{eqn	| r = \frac 1 {2 a p q} \ln \size {\frac {p t - q} {p t + q} } + C }} {{eqn	| r = \frac 1 {2 a p q} \ln \size {\frac {p \tan a x - q} {p \tan a x + q} } + C 	| c = substituting back for $t$ }} {{end-eqn}} {{qed}}
With a view to expressing the primitive in the form: :$\displaystyle \int u \frac {\d v} {\d x} \rd x = u v - \int v \frac {\d u} {\d x} \rd x$ let: {{begin-eqn}} {{eqn | l = u       | r = \sin^{m - 1} a x       | c =  }} {{eqn | ll= \leadsto       | l = \frac {\d u} {\d x}       | r = a \paren {m - 1} \sin^{m - 2} a x \cos a x       | c = Derivative of $\sin a x$, Derivative of Power, Chain Rule for Derivatives }} {{end-eqn}} and let: {{begin-eqn}} {{eqn | l = \frac {\d v} {\d x}       | r = \sin a x \cos^n a x       | c =  }} {{eqn | ll= \leadsto       | l = v       | r = \frac {-\cos^{n + 1} a x} {\paren {n + 1} a}       | c = Primitive of $\cos^n a x \sin a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \sin^m a x \cos^n a x \rd x       | r = \int \paren {\sin^{m - 1} a x} \paren {\sin a x \cos^n a x} \rd v       | c =  }} {{eqn | r = \paren {\sin^{m - 1} a x} \paren {\frac {-\cos^{n + 1} a x} {\paren {n + 1} a} }       | c = Integration by Parts }} {{eqn | o =        | ro= -       | r = \int \paren {\frac {-\cos^{n + 1} a x} {\paren {n + 1} a} } \paren {a \paren {m - 1} \sin^{m - 2} a x \cos a x} \rd x + C       | c =  }} {{eqn | r = \frac {-\sin^{m - 1} a x \cos^{n + 1} a x} {a \paren {n + 1} } + \frac {m - 1} {n + 1} \int \sin^{m - 2} a x \cos^{n + 2} a x \rd x + C       | c = simplifying }} {{eqn | r = \frac {-\sin^{m - 1} a x \cos^{n + 1} a x} {a \paren {n + 1} }       | c =  }} {{eqn | o =        | ro= +       | r = \frac {m - 1} {n + 1} \int \sin^{m - 2} a x \cos^n a x \paren {1 - \sin^2 a x} \rd x + C       | c = Sum of Squares of Sine and Cosine }} {{eqn | r = \frac {-\sin^{m - 1} a x \cos^{n + 1} a x} {a \paren {n + 1} } + \frac {m - 1} {n + 1} \int \sin^{m - 2} a x \cos^n a x \rd x       | c = Linear Combination of Integrals }} {{eqn | o =        | ro= -       | r = \frac {m - 1} {n + 1} \int \sin^m a x \cos^n a x \rd x + C       | c =  }} {{end-eqn}} Hence after rearranging: {{begin-eqn}} {{eqn | r = \frac {-\sin^{m - 1} a x \cos^{n + 1} a x} {a \paren {n + 1} } + \frac {m - 1} {n + 1} \int \sin^{m - 2} a x \cos^n a x \rd x       | o =        | c =  }} {{eqn | r = \int \sin^m a x \cos^n a x \rd x + \frac {m - 1} {n + 1} \int \sin^m a x \cos^n a x \rd x + C       | c =  }} {{eqn | r = \frac {n + 1} {n + 1} \int \sin^m a x \cos^n a x \rd x + \frac {m - 1} {n + 1} \int \sin^m a x \cos^n a x \rd x + C       | c = common denominator }} {{eqn | r = \frac {m + n} {n + 1} \int \sin^m a x \cos^n a x \rd x + C       | c = simplifying }} {{eqn | ll= \leadsto       | l = \int \sin^m a x \cos^n a x \rd x       | r = \frac {-\sin^{m - 1} a x \cos^{n + 1} a x} {a \paren {m + n} } + \frac {m - 1} {m + n} \int \sin^{m - 2} a x \cos^n a x \rd x + C       | c = simplifying }} {{end-eqn}} {{qed}}
With a view to expressing the primitive in the form: :$\displaystyle \int u \frac {\d v} {\d x} \rd x = u v - \int v \frac {\d u} {\d x} \rd x$ let: {{begin-eqn}} {{eqn | l = u       | r = \cos^{n - 1} a x       | c =  }} {{eqn | ll= \leadsto       | l = \frac {\d u} {\d x}       | r = -a \paren {n - 1} \cos^{n - 2} a x \sin a x       | c = Derivative of $\cos a x$, Derivative of Power, Chain Rule for Derivatives }} {{end-eqn}} and let: {{begin-eqn}} {{eqn | l = \frac {\d v} {\d x}       | r = \sin^m a x \cos a x       | c =  }} {{eqn | ll= \leadsto       | l = v       | r = \frac {\sin^{m + 1} a x} {\paren {m + 1} a}       | c = Primitive of $\sin^n a x \cos a x$ }} {{end-eqn}} Then: {{begin-eqn}} {{eqn | l = \int \sin^m a x \cos^n a x \rd x       | r = \int \paren {\cos^{n - 1} a x} \paren {\sin^m a x \cos a x} \rd v       | c =  }} {{eqn | r = \paren {\cos^{n - 1} a x} \paren {\frac {\sin^{m + 1} } {\paren {m + 1} a} }       | c = Integration by Parts }} {{eqn | o =        | ro= -       | r = \int \paren {\frac {\sin^{m + 1} } {\paren {m + 1} a} } \paren {-a \paren {n - 1} \cos^{n - 2} a x \sin a x } \rd x + C       | c =  }} {{eqn | r = \frac {\sin^{m + 1} a x \cos^{n - 1} a x} {a \paren {m + 1} } + \frac {n - 1} {m + 1} \int \sin^{m + 2} a x \cos^{n - 2} a x \rd x + C       | c = simplifying }} {{eqn | r = \frac {\sin^{m + 1} a x \cos^{n - 1} a x} {a \paren {m + 1} }       | c =  }} {{eqn | o =        | ro= +       | r = \frac {n - 1} {m + 1} \int \sin^m a x \paren {1 - \cos^2 a x} \cos^{n - 2} a x \rd x + C       | c = Sum of Squares of Sine and Cosine }} {{eqn | r = \frac {\sin^{m + 1} a x \cos^{n - 1} a x} {a \paren {m + 1} } + \frac {n - 1} {m + 1} \int \sin^m a x \cos^{n - 2} a x \rd x       | c = Linear Combination of Integrals }} {{eqn | o =        | ro= -       | r = \frac {n - 1} {m + 1} \int \sin^m a x \cos^n a x \rd x + C       | c =  }} {{end-eqn}} Hence after rearranging: {{begin-eqn}} {{eqn | r = \frac {\sin^{m + 1} a x \cos^{n - 1} a x} {a \paren {m + 1} } + \frac {n - 1} {m + 1} \int \sin^m a x \cos^{n - 2} a x \rd x       | o =        | c =  }} {{eqn | r = \int \sin^m a x \cos^n a x \rd x + \frac {n - 1} {m + 1} \int \sin^m a x \cos^n a x \rd x + C       | c =  }} {{eqn | r = \frac {m + 1} {m + 1} \int \sin^m a x \cos^n a x \rd x + \frac {n - 1} {m + 1} \int \sin^m a x \cos^n a x \rd x + C       | c = common denominator }} {{eqn | r = \frac {m + n} {m + 1} \int \sin^m a x \cos^n a x \rd x + C       | c = simplifying }} {{eqn | ll= \leadsto       | l = \int \sin^m a x \cos^n a x \rd x       | r = \frac {\sin^{m + 1} a x \cos^{n - 1} a x} {a \paren {m + n} } + \frac {n - 1} {m + n} \int \sin^m a x \cos^{n - 2} a x \rd x + C       | c = simplifying }} {{end-eqn}} {{qed}}