Finding $P$ such that $P^TAP$ is a diagonal matrix 
Let $$A = \left(\begin{array}{cc} 2&3 \\ 3&4  \end{array}\right) \in
M_2(\mathbb{C})$$
Find $P$ such that $P^TAP = D$ where $D$ is a diagonal matrix.

So here's the solution:
$$A = \left(\begin{array}{cc|cc} 2&3&1&0\\ 3&4&0&1    \end{array}\right) \sim \left(\begin{array}{cc|cc} 2&0&1&-3/2\\ 0&-1/2&0&1    \end{array}\right)$$
Therefore, $$P = \left(\begin{array}{cc} 1&-3/2\\ 0&1    \end{array}\right) \\ P^TAP = \left(\begin{array}{cc} 2&0\\ 0&-1/2    \end{array}\right) $$
What was done here exactly? I'd be glad elaborate about the process.
Thanks.

When you parameterize conics with rotation, its usual make the variable change $\mathbf {X=P^TY}$ so that $P^T\mathbf{A}P=D$ where $D$ is a diagonal matrix  and $\mathbf{A}$ is the matrix associate to the conics. The goal   is    eliminate cross terms $Bxy$.
The change of variable $\mathbf {X=P^TY}$ is deduced by completing the square (with respect to $x$ and $y$) in the conic of equation
$Ax^2+Bxy+Cy^2+Dx+Ey+F=0$
If $B \neq 0 $ and $C \neq 0, $ the matrix $\mathbf {A} = 
\begin{pmatrix} A & B/2 \\ B/
      2 & A\end{pmatrix} $ is "diagonalized" by $\mathbf {P} = \
\begin {pmatrix} 1 & 0 \\ - 
      B/(2 C) & 1\end {pmatrix} $ because $$\mathbf {P}^
      T\mathbf {A}\mathbf {P} = \left(
\begin{array}{cc}
 A-\frac{B^2}{4 C} & 0 \\
 0 & C \\
\end{array}
\right)$$
If $B \neq 0 $ and $A \neq 0, $ the matrix $\mathbf {A} = 
\begin{pmatrix} A & B/2 \\ B/
      2 & A\end{pmatrix} $ is "diagonalized" by $\mathbf {P} = \
\begin {pmatrix} 1 & - 
      B/(2 C) \\ 0 & 1\end {pmatrix} $ because $$\mathbf {P}^
      T\mathbf {A}\mathbf {P} = \left(
\begin{array}{cc}
 A & 0 \\
 0 & C-\frac{B^2}{4 A} \\
\end{array}
\right)
$$
As special case, If $A=C$ then $\mathbf{P}=\left(
\begin{array}{cc}
 1 & 1 \\
 1 & -1 \\
\end{array}
\right)$.
$$\mathbf {P}^
      T\mathbf {A}\mathbf {P}=\left(
\begin{array}{cc}
 2 A+B & 0 \\
 0 & 2 A-B \\
\end{array}
\right)$$
In this last case,  if you take $\frac{1}{\sqrt{2}}\mathbf P$, you get eingevalues in diagonal
Edit: For a general method you can see: "Linear Algebra
Done Wrong"  by Sergei Treil
).
