- Let $s$ be the length of time the object spends accelerating at rate $a$, and $t$ be the length of time the object spends accelerating at rate $d$.
- Assuming $a$ is positive and $d$ is negative (!), the maximum speed occurs after the object has finished accelerating at rate $a$.
- The average velocity of an object over a certain time period is equal to the difference between the ending and starting velocities, divided by the length of the time period. From this, we find that
$$\begin{align*}
a = \frac{V_x - V_A}{s} &\qquad& d = \frac{V_B-V_x}{t}\\
s = \frac{V_x - V_A}{a} &\qquad& t = \frac{V_B-V_x}{d}\\
as = (V_x-V_A) & \qquad & dt = V_B - V_x
\end{align*}$$
- If an object starts with velocity $v$, then travels for time $\tau$ at constant acceleration $\alpha$, it travels a distance equal to $v\tau + \frac{1}{2}\alpha\tau^2$. From this we find that:
$$D = \left[V_As + \frac{1}{2}as^2\right] + \left[V_xt + \frac{1}{2}dt^2\right]$$
- Using our formulas for $as = (V_x-V_A)$ and $dt = (V_B - V_x)$, we get:
$$D = s\left[V_A + \frac{1}{2}(V_x - V_A)\right] + t\left[V_x + \frac{1}{2}(V_B - V_x)\right]$$
$$D = s\left[\frac{1}{2}(V_x + V_A)\right] + t\left[\frac{1}{2}(V_B + V_x)\right]$$
- Using our formulas for $s = \frac{V_x-V_A}{a}$ and $t=\frac{V_B-V_x}{d}$, we get:
$$D = \left[\frac{1}{a}(V_x - V_A)\right] \left[\frac{1}{2}(V_x + V_A)\right] + \left[\frac{1}{d}(V_B - V_x)\right]\left[\frac{1}{2}(V_B + V_x)\right]$$
- We multiply by $2ad$:
$$2adD = d\left(V_x - V_A\right)\left(V_x + V_A\right) + a\left(V_B - V_x\right)\left(V_B + V_x\right)$$
$$2adD = d\left(V_x^2 - V_A^2\right) + a\left(V_B^2 - V_x^2\right)$$
- Collect terms involving $V_x$ :
$$(d-a)V_x^2 = dV_A^2 - aV_B^2 + 2adD $$
- Solve for $V_x$, as required:
$$V_x = \sqrt{\frac{aV_B^2 - dV_A^2 - 2adD}{a-d}}$$
Note that in the special case that $a = -d$, we recover the solution to your earlier problem:
$$V_x = \sqrt{\frac{aV_A^2 + aV_B^2 + 2a^2D}{2a}}$$
$$V_x = \sqrt{\frac{V_A^2 + V_B^2}{2} + aD}$$