\documentclass[a3paper]{article}
\usepackage{mathtools}
\usepackage{color}
\begin{document}
\title{Integrals Out Of The Box}
\author{Amit Yaron}
\date{July 2019}
\maketitle
\section{Introduction}
If you know how to integrate and elementary function, it is probably because
you have derived a function and got the integrand as a result.
For other functions you may need to use methods such as integration by
substitution or integration by parts or use other tricks. One trick used for
the integration of $\csc{x}$ is multiplying the numerator and denominator by
the same factor. In this document I will show you how to find that factor.
\section{Finding the Useful Function and Integrating by Substitution}
In this section I will define a function $f(x)$ such that $f'(x) = -(\csc x) f(x)$
What do the function $\csc$ and $\cot$ have in common? They have forms in which
$\sin$ is the denominator, and when you derive such function, you square the
denominator. Here, the denominator is $\sin x$, and sqaring it means multiplying
by $\csc x$
Let us derive $\csc x$ and $\cot x$:
\begin{align}
\frac{d}{dx}\csc x = \frac{d}{dx}\frac{1}{\sin x}=-\frac{\cos x}{\sin^2 x} =
-(\cot x)(\csc x)\\
\frac{d}{dx}\cot x=\frac{d}{dx}\frac{\cos x}{\sin x} = \frac{-\sin^2 x - \cos^2 x}{\sin^2 x}=-\frac{1}{\sin^2 x} = -\csc^2 x
\end{align}
Now, if we define $f(x)=\cot(x) + \csc(x)$, the from (1) and (2):
\begin{align}
\noindent f'(x) = -\csc^2 x - (\csc x)(\cot x) = - (\csc x)(\csc x + \cot x) =
-(\csc x)f(x)\Rightarrow \nonumber \\ \Rightarrow \csc x = -\frac{f'(x)}{f(x)}\Rightarrow
\int \csc x dx = -\int\frac{f'(x)}{f(x)}dx= -\ln|f(x)|+C =\nonumber\\= \color{red}-\ln|\csc x + \cot x| + C \nonumber
\end{align}
\end{document}