The surface of the Earth can be described by the standard polar coordinate system $(\theta,\phi)$.
It can also be described by the longitude & latitude coordinate system, where the longitude $\lambda$ is given by $\lambda=\frac{\pi}{2}-\theta$ and the longitude is just $\phi $.
The Mercator projection can be used to make a 2D map of the Earth's surface by introducing functions $x=x(\lambda,\phi)$ and $y=y(\lambda,\phi)$ and using them as Cartesian coordinates on a flat piece of paper. The funcitions are given by $$x={W\phi \over 2\pi},$$ $$y={H \over 2\pi}\ln[\tan({\pi\over4}+{\lambda\over2})],$$ where $W$ and $H$ are the width and height of the map respectively.
I am trying to show that such the Mercator projection preserves angles between directions on the 3D surface and on the 2D map.
As a starting point, I found the line element corresponding to the $(\lambda,\phi)$ coordinate system as $$ds^2=a^2(d\lambda^2+\cos^2\lambda d\phi^2)$$ where $a$ is the radius of Earth.
I also found the line element corresponding to the $(x,y)$ coordinte system as $$ds^2={4\pi^2a^2 \over \cosh^2({2\pi y\over H})}[{dx^2 \over W^2}+{dy^2\over H^2}].$$
How should I proceed further to show that the Mercator projection preserves angles?
Or more generally, when given two line elements in two different coordinate systems, how can the angles between two directions in each coordinate system be compared?
How to show that the Mercator projection preserves angles
with:
3D Line element \begin{align*} &\text{ds}_{3D}^2=G_{3D}(1,1)\,(du_1)^2+G_{3D}(2,2)\,(du_2)^2\\ \end{align*}
and
2D Line element \begin{align*} &\text{ds}_{2D}^2=G_{2D}(1,1)\,(du_1)^2+G_{2D}(2,2)\,(du_2)^2 \end{align*} where G is the metric
angles preserves mean conformal mapping thus: $$\text{ds}_{2D}=\Lambda\text{ds}_{3D}$$
thus
$$\Lambda^2=\frac{G_{2D}(2,2)}{G_{3D}(2,2)}=\frac{G_{2D}(1,1)}{G_{3D}(1,1)}\tag 1$$
your example
$$du_1=d\varphi\,,du_2=d\lambda$$
Sphere
$$\vec{R}_s=\rho\,\left[ \begin {array}{c} \cos \left( \lambda \right) \cos \left( \varphi \right) \\ \sin \left( \lambda \right) \cos \left( \varphi \right) \\ \sin \left( \varphi \right) \end {array} \right] $$ Where:
The Metric of the Sphere is: $$G_{3D}=\rho\left[ \begin {array}{cc} 1&0\\ 0& \left( \cos \left( \varphi \right) \right) ^{2}\end {array} \right] $$
Mercator Vector
$$\vec{R}_M=\left[ \begin {array}{c} \frac 1 2\,{\frac {H\ln \left( \tan \left( \frac 1 4\, \pi +\frac 1 2\,\varphi \right) \right) }{\pi }}\\ \frac 1 2\, {\frac {W\lambda}{\pi }}\end {array} \right] $$
Notice that I changed your coordinate $\varphi\mapsto \lambda$ and $\lambda \mapsto \varphi$ and also your x and y coordinates $x \Leftrightarrow y$
The Mercator Metric is: $$G_{2D}= \left[ \begin {array}{cc} {\frac {{H}^{2}}{2\,{\pi }^{2}\cos \left( 2 \,\varphi \right) +2\,{\pi }^{2}}}&0\\ 0&\frac 1 4\,{ \frac {{W}^{2}}{{\pi }^{2}}}\end {array} \right] $$
thus equation (1)
$$\frac{G_{2D}(2,2)}{G_{3D}(2,2)}= \frac{G_{2D}(1,1)}{G_{3D}(1,1)}$$
With those "changes" the angles are now preserved!