## Common Graphs
### $f(x)=2$

### $f(x)=x$

### $f(x)=|x|$

### $f(x)=\frac{1}{x}$

### $f(x)=x^2$

### $f(x)=x^3$

### $f(x)=\sqrt{x}$

### $f(x)=\sqrt[3]{x}$

## Transformations
We can think of the various operations applied to the input as transformations to the graph of the function that manipulates it. Understanding how those transformations affect the graph of a function helps us build an intuition of the relationship between the function's input and its output.
### Vertical Shift
Let us consider the function $f(x)+k$. Because $k$ is added after the manipulation of the input value, the graph will be shifted up, because we're adding to the output.
This is for instance the case of $f(x)=x^2+3$. The graph of this function will look like exactly like that of $x^2$, shifted up by three units.
### Horizontal Shift
If now we apply a change before manipulating the input value, then the graph will be moved in the opposite direction of the change. This is the case because whatever happened at $x=0$ now happens at $x=-2$, since for the same $x$ input value, we now have the output of what would have been the output of $x+2$ before applying the transformation. So $f(x+h)$ moves the graph to the left by $h$ units, while $f(x-h)$ moves it the right.
For example, $f(x)=|x+2|$ produces a left shift of the graph $f(x)=|x|$, because we add $2$ to the input value before applying any other changes.
### Combining Shifts
It is of course possible to combine those two types of transformations.
Taking the function $f(x)=(x+1)^3-1$, we see that it produces both a left shift, as we add $1$ to the input value before manipulating it further, and a down shift, since we remove $1$ from the output at the end.
### Vertical Stretch / Compression
Consider the expression $a \cdot f(x)$. The output value is multiplied by $a$, which means, if $a>1$, that the graph will be stretched vertically, as output values grow faster than they used to by a factor of $a$. If, on the other hand, $0<a<1$, the graph will be compressed vertically as output values are now a fraction of what they used to be before this transformation.
Looking at the function $f(x)=2x^2$, we now understand that $a=2$, which will result effectively in stretching the graph upward, the output values now growing two times faster.
### Horizontal Stretch / Compression
A horizontal stretch or compression has the form $f(ax)$. It's usually the case that a horizontal stretch or compression can be changed into a vertical one. If $a>1$, the graph will be compressed horizontally. If $0<a<1$, the graph will be stretched horizontally. Again, what happens within parentheses produces a result that seemingly goes against intuition.
Yet this is logical, because what it means is that for the same output, we now have an input smaller by a factor of $a$ when $a>1$. Taking the function $f(x)=(3x)^2$, we see that $f(2)=36$, when if we do not multiply by $9$ (because $3^2=9$), $f(2)=4$.
The reverse is also true: For the same input, we now have an output bigger by a factor of $a$, which in essence is the same as a vertical stretch, which stretches by compressing horizontally to make the graph narrower.
### Reflection
Changing the sign of the output, i.e. $-f(x)$, reflects the graph about the $x$-axis, as positive output now becomes negative. This is the case for instance of $f(x)=-\sqrt[3]{x}$.
Changing the sign of the input, i.e. $f(-x)$, flips the graph along the $y$-axis, as positive input now becomes negative, like $f(x)=\sqrt{-x}$.
### Examples
#### $f(x)=-\frac{1}{2}|x-3|+2$
- We start from an even-looking graph, $|x|$, with symmetry about the $y$ axis;
- We shift up the graph by $2$ units with $+2$;
- We shift right the graph by $3$ units with $-3$;
- We compress the graph vertically (or stretch it horizontally), multiplying by $\frac{1}{2}$;
- We reflect the graph horizontally with the negative sign in front of $-\frac{1}{2}$.

#### $g(x)=-\frac{1}{3}(x+1)^3-1$
- The base function $x^3$ gives us an S-shaped graph ([[Graphing Functions#$f(x)=x 3$|here]]);
- The $-1$ at the end shifts the graph down by $1$ unit;
- The $+1$ applied to the input before any other transformations creates us a left shift by $1$ unit;
- $\frac{1}{3}$ compresses the graph vertically, effectively flattening it
- The negative sign of $-\frac{1}{3}$ causes it to be reflected vertically

#### $f(x)=\frac{3}{x-2}+1$
- We can rewrite it to better understand the transformations: $f(x)=3\cdot\frac{1}{x-2}+1$;
- We now see the base function dictating the shape of the graph is $\frac{1}{x}$ ([[Graphing Functions#$f(x)= frac{1}{x}$|here]]);
- $+1$ causes a shift up by $1$ units;
- $-2$ causes a shift right by $2$ units;
- Multiplying by $3$ creates a vertical stretch.

#### $g(x)=2\cdot\sqrt{1-x}+3$
- Rewriting the expression to make the transformations clearer: $g(x)=2\cdot\sqrt{-(x-1)}+3$;
- The graph's shape is defined by the function $\sqrt{x}$ ([[Graphing Functions#$f(x)= sqrt{x}$|here]]);
- We see a shift up by $+3$ units;
- A shift right by $1$ unit;
- A vertical stretch by a factor of $2$;
- A vertical reflection of the graph applied by the minus sign.
