[Math] How to find the equation of the graph reflected about a line

algebra-precalculusfunctionsgraphing-functionstransformation

Consider the graph of $y = e^x$

(a) Find the equation of the graph that results from reflecting about the line $y = 4$.

(b) Find the equation of the graph that results from reflecting about the line $x = 5$.

I get that in order for the equation to reflect about the $y$-axis, the function would have to be $y= – e^x$, and also for it to reflect about the $x$-axis the function should be something like $y= e^{-x}$.

But what to do when a line is not one of the coordinate axes?

Best Answer

Adding to @Adriano's answer, if you want to reflect $y=f(x)$ across $y=mx+b$ you have to reflect the function by the x-axis and then rotate it by $\theta=\pi+2\tan^{-1}(m)$ radians.

So if we have $y=f(-x)$, then by using the rotation matrix in linear algebra, we can set $x=x'\cos(\theta)+y'\sin(\theta)$ and $y=y'\cos(\theta)-x'\sin(\theta)$.

So the reflection over $y=mx$ equals

$$\left(\frac{2m}{2m^2+1}x'-\frac{1-m^2}{m^2+1}y'\right)=f\left(-\left(-\frac{2m}{m^2+1}y'-\frac{1-m^2}{m^2+1}x'\right)\right)$$

A better explanation for this formula is shown here.

Then with $b$, you have to shift $y=f(-x)$ down $b$ vertically to get $(y+7)=f(-x)$. Then after the rotation, the rotated function should be shifted up vertically by seven. Thus the final formula is

$$\left(\frac{2m}{2m^2+1}x'-\frac{1-m^2}{m^2+1}(y'-b)+b\right)=f\left(\frac{2m}{m^2+1}(y'-b)+\frac{1-m^2}{m^2+1}x'\right)$$

Now substitute $f(x)=e^{-x}$