# Applying a function to both sides of equation

1. Oct 15, 2012

### mr0no

How can I be sure if I can apply a function to both sides of an equation and preserve equality?
for example:
x = y ⇔ x2 = y2
or
x = y ⇔ $\sqrt{}x$ = $\sqrt{}y$
or
x < y ⇔ log(x) < log(y)

What's up with that?

2. Oct 15, 2012

### haruspex

You can alays apply the same operation to both sides of an equation (in the modern sense of indicating equality). If they're equal to start with and you do the same to both sides then they must still be equal.
But that does not work for inequalities. If you apply a monotonically decreasing function to each side (negation, inversion of items having the same sign) you must reverse the inequality. If the function is not even monotone then all bets are off.

3. Oct 15, 2012

### mathman

Not always: Example: (-1)2 = 12, but -1 ≠ 1.

4. Oct 15, 2012

### mr0no

Exactly

5. Oct 15, 2012

### dextercioby

Mathematically speaking, the function must be injective, in case of equalities.

Last edited: Oct 15, 2012
6. Oct 15, 2012

### Mute

The implication is only guaranteed to be one way. If x = y, then you can safely "apply a function to both sides" because you know x = y. That is, let z = f(x). But, since we know x = y, we can replace x with y in this equation, so z = f(y). The result z is the same in both cases, so we know f(x) = f(y).

However, given f(x) = f(y), you cannot necessarily conclude x = y, because the function f may not have a unique inverse. For examples, x2 = y2 does not imply x = y, because it is possible that x = -y. However, this doesn't contradict what I said about because taking the square root function of both sides does not give you "x = y". If you apply the square root function to both sides, what you actually get is |x| = |y|, which is true, because $\sqrt{a^2} = |a|$ for any real number a.

The case is of inequalities is trickier and a different situation. If x < y, then you can only conclude f(x) < f(y) if f is a monotonically increasing function only the region that contains x and y. That is, if f'(x) > 0 on the entire region containing x and y.

For example, consider 0<x<y and f(t) = exp(t). Since exp(t) is always increasing, we can conclude exp(x) < exp(y). However, consider a function g(t) = exp(-t). This function is always decreasing, so x < y actually implies g(x) > g(y).

For a trickier example, let h(t) = sin(t), and let $0 < x < y < \pi/2$. The sine function is monotonically increasing on this interval, so we can conclude that sin(x) < sin(y). However, if it were the case that 0 < x < y, but $y > \pi/2$, then we cannot conclude that sin(x) < sin(y) because it may not be true, as sin(t) is decreasing on $\pi/2<t<3\pi/2$.

7. Oct 15, 2012

### haruspex

What operation are you applying to both sides of what initial equation?
If you're starting with (-1)2 = 12 and square-rooting you get √((-1)2) = √(12). It is not valid to reduce that to -1 = 1. You can make it 1 = 1, or ±1 = ±1.

8. Oct 16, 2012

### mathman

The first item on the list is x = y is equivalent to x2 = y2. This not necessarily true.

9. Oct 16, 2012

### haruspex

Allow me to rephrase my original post without changing its burden:
Square rooting is a defined function. It can be applied to both sides of an equation with confidence. Going from x2 to x is not a defined function. The square root of x2 is ±x, and √(x2) is defined to be |x|.

10. Oct 16, 2012

### pwsnafu

It's a bit more subtle than that. The square root function has domain $[0,\infty)$ and range $[0,\infty)$. Going from x2 to x is always fine provided you stay with this domain. If x is outside of this, you now have problems, and it is no longer a function.

The phrase "the square root" is reserved for the principle branch, which in the case of reals is always positive. The radical symbol, √, is also reserved for this. This is why the quadratic formula has a ±.

Lastly, and this is a minor technicality, √(x2) is not "defined" as |x|. The former is defined by the composition of two functions. The latter has it's own (piecewise) definition. These two function just happen to be equal to each other pointwise. But you shouldn't say one is "defined" in terms of the other.

I know what you are trying to say, you just need to be a bit more precise in your vocab choice.

11. Oct 16, 2012

### haruspex

The problem is not that x2 was outside that domain, but that x was outside that range.
OK, but it is defined in such a way that the two are equivalent, and this is pretty much what you are saying wrt range.
Everyone else responding on this thread appears to think that "going from x2 to x" is a legitimate algebraic manoeuvre, but which is an exception to the rule that you can freely apply the same function to both sides of an equation. My point is that it is not an algebraic operation at all, it is a lexical one, and there cannot be exceptions to the rule.

12. Oct 16, 2012

### pwsnafu

Correct.

Again correct.

What do you mean by "lexical" operation?

13. Oct 16, 2012

### skiller

The fact remains that mathman was correct. He was objecting to the statement that x2=y2 implies that x=y.

14. Oct 17, 2012

### haruspex

I never said it did.

15. Oct 17, 2012

### haruspex

A manipulation of the symbols; in this case, removing the exponent.

16. Oct 17, 2012

### Mute

No, the OP said it did [saying x2 = y2 and x=y are equivalent]. mathman's post that you responded to was merely give a concrete example to demonstrate a case for which x2 = y2 but x = y, demonstrating that the equivalence the OP posited was false. mathman did not claim he was applying any functional (or even lexical) operation to both sides of the equation, it was just an example to demonstrate the falsity of the OP's claim.

17. Oct 17, 2012

### Staff: Mentor

No.
This is an extremely common misconception that comes up here way too often. Would you say that $\sqrt{2^2} = \pm 2$? Although it is true that 4 has two square roots, the expression $\sqrt{4}$ denotes the principal square root, or 2.
Right, and this too has a single value.

18. Oct 17, 2012

### skiller

x ≠ y

19. Oct 17, 2012

### Mute

Whoops! Thanks for catching that typo! Too bad I can't go back and edit it now.

20. Oct 17, 2012

### skiller

Thanks! Not sure what haruspex (no offence, mate!) was trying to bring into the discussion really. The root function being positive wasn't really what mathman was talking about.

But where's mr0no now?

Last edited: Oct 17, 2012