[Math] Rearranging quadratic equations

quadratics

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
testanswer <- solution(testproblem[1])
testanswer

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.

Best Answer

Your line

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

should be instead

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$.

Related Question