Logarithmic equation, some variables in bases and in arguments
We can use that
$$\log_a^b=\frac{\log a}{\log b}$$
therefore
$$40\log_{4x}x^\frac{1}{2}-14\log_{16x}x^3=-\log_{\frac{1}{2}x}x^2$$
$$40\frac{\log x^\frac{1}{2}}{\log {4x}}-14\frac{\log x^3}{\log {16x}}=-\frac{\log x^2}{\log {\frac{1}{2}x}}$$
$$20\frac{\log x}{\log {x}+\log 4}-42\frac{\log x}{\log {x}+\log 16}=-2\frac{\log x}{\log {x}+\log \frac12}$$
and eliminating $\log x \neq 0$ (which is a solution)
$$\frac{10}{\log {x}+2\log 2}-\frac{21}{\log {x}+4\log 2}=-\frac{1}{\log {x}-\log 2}$$
then let $y=\log x$ and $a=\log 2$ to obtain
$$\frac{10}{y+2a}-\frac{21}{y+4a}+\frac{1}{y-a}=0$$
$$\frac{10(y+4a)(y-a)-21(y+2a)(y-a)+(y+2a)(y+4a)}{(y+2a)(y+4a)(y-a)}=0$$
$$\frac{10(y^2+3ay-4a^2)-21(y^2+ay-2a^2)+(y^2+6ay+8a^2)}{(y+2a)(y+4a)(y-a)}=0$$
$$\frac{-10 y^2+15 ay+10a^2}{(y+2a)(y+4a)(y-a)}=0$$
$$\frac{-5(y-2a)(2y+a)}{(y+2a)(y+4a)(y-a)}=0$$
that is
$\log x = 2\log 2$
$2\log x = -\log 2$
Nice, I wanted to try myself. I worked the first step as you did, getting to
$$\frac{20}{\log_x4x}-\frac{42}{\log_x16x}+\frac{2}{\log_x\frac{1}{2}x}=0,$$
valid if $x\neq 1$, which is anyhow a solution to the original equation.
Then, dividing by $2$ and rewriting the logarithms as you did, yields
$$\frac{10}{1+\log_x4}-\frac{21}{1+\log_x 16}+\frac1{1-\log_x 2}=0.$$
From here I proceded inverting base and arguments and replacing $\log_{16} x$ with $t$, for simplicity
$$\frac{10}{1+\frac1{2t}}-\frac{21}{1+\frac1{t}}+\frac1{1-\frac1{4t}}=0,$$
which, again for $t\neq 0$, is equivalent to
$$\frac{20}{2t+1}-\frac{21}{t+1}+\frac4{4t-1}=0.$$
Least common denominator brings you to the quadratic equation
$$16t^2-6t-1=0,$$
with the desidered solutions, i.e. $t=\frac12$ and $t=-\frac18$.