Find $a$ and $b$ such that $4(b^3-a^3)-3(b^4-a^4)=\frac{1}{2}$ and $b-a$ gets minimum. I was solving this problem that for $f(x)=12x^2-12x^3, 0<x<1$ that is probability density function we have $P(a<X<b)=\frac{1}{2}$. So we have
$$P(a<X<b)=\int_{a}^{b}f(x)dx=\frac{1}{2}$$
with calculation I reached to this: $4(b^3-a^3)-3(b^4-a^4)=\frac{1}{2}$. But I don't know how to find $a$ and $b$ such that $b-a$ becomes minimum.
 A: Let's rewrite our function in terms of $s = a + b$ and $d = b-a$. Then we have
$$
4(b^3 - a^3) + 3(b^4 - a^4) = \frac{d}{2}\left[d^2(2-3s) + 3(2-s)s^2\right] = \frac{1}{2}
$$
Now we can proceed by implicit differentiation. We can define $d(s)$ as satisfying the equation $d[d^2(2-3s) + 3(2-s)s^2] =1$. Differentiating with respect to $s$ gives
$$
\left[(2-3s)d^2+(2-s)s^2\right] d'(s)+ \left[d^2-s(4-3s)\right] = 0.
$$
When $d$ is minimized, $d'(s) = 0$, so we have at the minimum that $d^2 = s(4-3s)$. This can be used in the constraint equation to give a system of two equations in two unknowns:
$$
d^2 = s(4-3s)\\
2ds(3s^2 -6s + 4) = 1.
$$
Eliminating either variable then gives a nasty 8th order polynomial that can only be solved numerically, and doing so gives $d\approx 0.2955$. However, we can actually get a fairly good rough estimate of $d$ analytically. Since $d$ is less than $1$, $d^2$ is probably fairly small. $s$ probably isn't small, so we know from the first equation that $4 - 3s$ is small. That is, $s$ is a little less than $4/3$. Putting this into the second equation gives that $d$ should be a little more than $9/32 \approx 0.28$, which it is.
A: Maple agrees with that Wolfram Alpha result...
with(Student[MultivariateCalculus]);
LagrangeMultipliers(b-a,[4*(b^3-a^3)-3*(b^4-a^4)-1/2],[a,b],output=detailed);
Omit the complex (non-real) solutions, result:
$$[a = 0.5078006996, b = 0.8033286760, lambda[1] = 0.6565853254, 
  b - a = 0.2955279764]\\
[a = -0.3147015671, b = 0.5218096119, lambda[1] = 0.6400203196, 
  b - a = 0.8365111790]
$$
These should be the minimum and maximum.
