Solution (source code)

= Solution

Isolate the <square root>: $\sqrt{2x^2+17}=3-x$. Its right side must be nonnegative, so retain the condition $x\leq3$ before squaring. Squaring then gives
$$
2x^2+17=(3-x)^2,\qquad x^2+6x+8=(x+2)(x+4)=0.
$$
Both candidates pass the original equation: $\sqrt{25}-2=3$ and $\sqrt{49}-4=3$. Thus
$$
\boxed{x=-2,\quad x=-4.}
$$
The substitution check excludes the possibility of extraneous roots introduced by squaring.