You can use vectors to prove this. Let $ABC$ be the triangle, $p,q,r$ slopes of $BC,AC,AB$, respectively. Note that $\overrightarrow{BC},\overrightarrow{CA},\overrightarrow{AB}$ are respectively parallel to $(1,p),(1,q),(1,r)$. By taking into account the triangle rule $\overrightarrow{AB}+\overrightarrow{BC}+\overrightarrow{CA}=\overrightarrow{0}$, we may assume:
\begin{align}
\overrightarrow{BC}= (q-r,p(q-r)),\\
\overrightarrow{CA}= (r-p,q(r-p)),\\
\overrightarrow{AB}= (p-q,r(p-q)).\\
\end{align}
Let $T$ be the centroid. We know that $\overrightarrow{AT}= \frac{1}{3}(\overrightarrow{AB}+\overrightarrow{AC})= \frac{1}{3}(2p-q-r,pq+pr-2qr)$.
Let $H$ be the orthocenter. $\overrightarrow{AH}$ is parallel to $\overrightarrow{n_{BC}}:(-p(q-r),q-r)$ and $\overrightarrow{BH}$ is parallel to $\overrightarrow{n_{AC}}:(-q(r-p),r-p)$, so we can write:
\begin{align}
\overrightarrow{AH}=\alpha(-p(q-r),q-r),\\
\overrightarrow{BH}=\beta(-q(r-p),r-p).
\end{align}
Since $\overrightarrow{AB}= \overrightarrow{AH}-\overrightarrow{BH}$, we have:
\begin{align}
-\alpha\ p(q-r)+\beta\ q(r-p) = p-q,\\
\alpha(q-r)-\beta(r-p) =r(p-q).
\end{align}
Multiply the second equation by $q$ and add it to the first one to get: $\alpha(q-p)(q-r)=(qr+1)(p-q)$, wherefrom $\alpha=-\frac{qr+1}{q-r}$. So:
$$\overrightarrow{AH}= -\frac{qr+1}{q-r}(-p(q-r),q-r)= (pqr+p, -1-qr).$$
Now $\overrightarrow{HT}= \overrightarrow{AT}- \overrightarrow{AH}=$
$$=\frac{1}{3}(2p-q-r,pq+pr-2qr)-\frac{1}{3}(3pqr+3p, -3-3qr)=
\frac{1}{3}(-p-q-r-3pqr,3+pq+qr+rp).$$
The slope of the Euler line is thus equal to:
$$-\frac{3+pq+qr+rp}{p+q+r+3pqr}.$$