# Rearranging quadratic equations

I have an equation I'd like to rearrange that I'm having trouble with:

The equation goes:

$$r = 2ut - 0.333(2ut)^2$$

(on a computer I enter (2*u)*t - (0.333*((2*u)*t))^2 to make sure the order of operations done by the computer is correct.

However I'd like to rearrange it so as I can work out what the term $2ut$ is, if I have the value of $r$ is known. I suppose then the equation could be represented as:

$$r = x - 0.333x^2$$

I believe then this is a quadratic equation, just for full disclosure - because maths is not my strong suit at all (no formal education beyond English secondary school). I was given the equation in an email stated as this in plain text:

r = 2*u*t - 0.333(2*u*t)^2

I'm told there is a way to rearrange equations of this type but it is beyond me. Two suggestions I've had given to me were by a friend and by entering the thing in Wolfram Alpha:

First Solution:

$$2ut = \frac{6 \pm (36+4r)^{0.5}}2$$

Given to me in an email as:

2ut={6 + (36 + 4*r)^0.5 } /2

and

2ut={6 - (36 + 4*r)^0.5 } /2

However I've made these equations, both the one I'm trying to solve, and the solved version I've been given into R functions to test them and see if the input of the first is recovered by the output of the other:

problem <- function(u, t) {
mut <-  2 * u * t
r <- mut - (0.333 * (mut)^2)
return(c(r = r, "2ut" = mut))
}

solution <- function(r) {
universal <- (36 + 4 * r)^0.5
first <- (6 + universal) / 2
second <- (6 - universal) / 2
output <- c(first,second)
names(output) <- c("first 2ut", "second 2ut")
return(output)
}

testproblem <- problem(10e-9, 1000)
testproblem


Running this in R does not produce output that matches - i.e. the $2ut$ output by the first function does not match either of the outputs of the second function and so I can't conclude the solution to rearrange the equation is correct. I won't include the wolfram alpha solved one because it looks insane and doesn't work either.

Hopefully someone far wiser and well read in mathematics is able to help out with this.

Thanks, Ben.

EDIT:

I've tried again with some help of a friend and came out with the following workings:

$$r = 2ut - 0.333(2ut)^2$$ Can also be put: $$r = 0.333(2ut)^2 - 2ut$$ Which can also be put: $$r =0.333x^2 - x$$ And so we can use $$ax^2 + bx + c$$ So: $$0.333x^2 - x + r = 0$$ Multiply by 3 to eliminate the $0.0333$: $$x^2 - 6x + 3r = 0$$ And since: $$x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ And $a=1, b=-3, c=3r$, then: $$x = \frac{3\pm\sqrt{9-12r}}{2a}$$ This is as far as I understand (still may not be 100% right), but then I'm told: Since $x^2 = (2ut)^2$, $$(2ut)^2 = 1\frac12 \pm \frac{\left(\sqrt{9-12r}\right)}2$$ and so: $$x = ut = \frac12\left(\sqrt{1\frac12\pm\frac{\left(\sqrt{9-12r}\right)}2}\right)$$

But I'm still not sure if this is right.

r <- mut - (0.333 * mut)^2


r <- mut - (0.333 * (mut)^2)


As it stands now, your line represents $r = x - (0.333 x)^2 = x-0.110889 x^2$ when the actual equation is $r = x - 0.333 x^2$.

• Thanks, I've changed the R code but it still doesn’t look like $x$ is found properly. Commented Jan 23, 2014 at 12:46

$$r = 2ut - 0.333(2ut)^2$$

$$0.333(2ut)^2 - (2ut) + r = 0$$

$$2ut = \frac{1 \pm (1-4*0.333*r)^{0.5}}{2*0.333}= \frac{0.5 \pm (0.25-0.333*r)^{0.5}}{0.333}$$

Your solutions above seem to assume $0.333$ means $1/3$. Not sure if that was your intention.

If $0.333$ means $1/3$ then

$$2ut = 1.5 \pm (2.25-3*r)^{0.5}$$

• Hi Neil, yes I'm assuming that 0.333 is $\frac13$. Forgive me being dumb, why does this make the solution different to 0.333? Commented Jan 23, 2014 at 15:24
• Well you're not going to get exactly zero if you calculate your solution based on 1/3 and put it into a function using 0.333. Commented Jan 23, 2014 at 15:49