# 2.Absoulte Value

## 19.01.2021

### Contents/Index

1. Logarithmic
@2. Absoulte Value
3. The Square Root

The absolute value of $x$ is denoted as $|x|$. We have that $|x|$ is the largest of the two values $x$ and $-x$. Or we can write is as $$|x| = \begin{cases} x & x \geq 0 \\ -x & x \lt 0 \end{cases}$$ We have that $|x| \geq 0$. We can plot it with the following python3 code

import numpy as np import matplotlib.pyplot as plt def f(x): return np.abs(x) x = [float(x) / 10.0 for x in range(-1 * 100,100)] y = [f(x) for x in x] plt.plot(x,y) plt.show()

For which we get the plot as seen in Figure 1.

## The derivative of the absolute value

The derivative is given as $$|x|' = \frac{x}{|x|}$$ This looks more scary than it is. It just states that if $x \lt 0$, then $|x|' = -1$. If $x \gt 0$, then $|x|' = 1$. Note that the derivative is not defined when $x = 0$. We can derive the derivative. First rewrite $$|x| = \sqrt{x^2}$$ We use the chain rule to obtain $$\sqrt{x^2}' = \frac{1}{2 \sqrt{x^2}} \cdot 2x = \frac{x}{\sqrt{x^2}}$$ We substitute in order to obtain $$|x|' = \frac{x}{|x|}$$