# How do I rewrite this equation to solve for $t$

How do I rewrite this equation to solve for $t$?

$$x = (1 - t)^3 a + 3 (1 - t)^2 t b + 3 (1 - t) t^2 c + t^3 d$$

I should have paid better attention many, many years ago when I was in high school algebra!

If you want to take the time to explain how to rewrite it even better!

-
When $a,b,c,d$ range over $\mathbb{R}$, for instance, the rhs ranges over the whole set of real polynomials of degree $\leq 3$. So you need this. – 1015 May 27 '13 at 22:31
That wiki goes way above my head! Can I not "just" move everything but t from one side equation to the other? Im a math dummy! The extent of my math eduction is high school algebra and geometry. – Old Name May 27 '13 at 22:48
Here is an easy case: $x=c=d=0$ and $a=b=1$. Then you want $0=(1-t)^3+3(1-t)^2t=(1-t)^2((1-t)+3t)=(1-t)^2(1+2t)$, whose solutions are $0$ and $-1/2$. But if you take $a,b,c,d$ randomly, you will need to use techniques of the type I linked to. And you certainly can't isolate $t$ in general, as you seem to suggest. – 1015 May 27 '13 at 22:52

This looks like a problem derived from Bezier curves.

I assume that $x$, $a$, $b$, $c$, $d$ are all known, and we're trying to find $t$.

So, you just multiply out all the powers of $(1-t)$ and gather together the terms containing the same power of $t$. You will end up with four terms: one each for $t^3$, $t^2$, and $t$, and a constant term. You actually get: $$(-a+3b-3c+d)t^3 + (3a-6b+3c)t^2 + (-3a+3b)t + a - x =0$$

In other words, you will end up with something of the form: $$pt^3 + qt^2 + rt + s = 0$$

where $p=-a+3b-3c+d$, $q = 3a-6b+3c$, $r = -3a+3b$, and $s=a-x$.

This is a so-called "cubic" equation that you need to solve for $t$.

There are formulas that give you the solutions of cubic equations, just as there are formulas for solving quadratics, but the cubic ones are much more complicated. Some techniques are described on this Wikipedia page. Also, you can find many "cubic equation calculators" on the internet that will give you the solutions for specific given values of $x$, $a$, $b$, $c$, $d$.

-