I'm trying to calculate the following line integral $$-\int\vec E \cdot d\vec l$$ With $\vec E=\dfrac{1}{r^2}\, \hat r$ (radial electric field) and $d\vec l=dr \,\hat r$.
Definitions:
(Image Source: Introduction to Electrodynamics 4th - David J. Griffiths)
$$\left. \mbox{$ \begin{alignat}{1} \vec r &\equiv x\hat i+y \hat j + z\hat k \\ \\r&=\sqrt{x^2+y^2+z^2} \end{alignat} $}\right\} \implies \hat r=\frac{x\hat{i}+y\hat{j}+z\hat{k}}{(x^2+y^2+z^2)^{1/2}} $$
- $\vec r$ is the position vector
- $r$ is the magnitude of position vector
- $\hat r$ is a unit vector pointing radially outward
Method 1:
$$-\int\vec E \cdot d\vec l=-\int\frac{1}{r^2}\,dr\,(\hat r \cdot \hat r)=-\int \frac{1}{r^2}\,dr= \color{green}{\frac{1}{r}}$$
Method 2:
$$ \begin{alignat}{1} -\int\vec E \cdot d\vec l &= -\int \frac{1}{x^2+y^2+z^2}\frac{x\hat{i}+y\hat{j}+z\hat{k}}{(x^2+y^2+z^2)^{1/2}} \cdot (dx\, \hat i +dy\, \hat j + dz\, \hat k) \\[2px] &= -\int \frac{1}{(x^2+y^2+z^2)^{3/2}}\,(x\,dx+y\,dy+z\,dz) \\[2px] &= -\int \frac{x}{(x^2+y^2+z^2)^{3/2}}\,dx -\int \frac{y}{(x^2+y^2+z^2)^{3/2}}\,dy -\int \frac{z}{(x^2+y^2+z^2)^{3/2}}\,dz \\[2px] &= \frac{1}{\sqrt{x^2+y^2+z^2}}+\frac{1}{\sqrt{x^2+y^2+z^2}}+\frac{1}{\sqrt{x^2+y^2+z^2}} \\[2px] &= \frac{3}{\sqrt{x^2+y^2+z^2}} = \color{red}{\frac 3 r} \end{alignat} $$
The second method gave the wrong result. My question is: what is my conceptual mistake here and how can I make the second method work?