In High School Algebra , after studying how to plot a graph of $f(x)$ (rather called $y$) against $x$ in Cartesian coordinates, we studied several tests to determine the symmetry of the plotted graphs about the $x$ and $y$ axes, and around the origin point.
The tests seemed pretty simple and intuitive, you can Google them if you need to.
However, when I thought of investigating the symmetry of a certain function (say $f(x)$) about a given equation of a line or a curve (say $g(x)$), the solution did not seem to be that intuitive.
The case seemed trivial and easy when $g$ was simply $x=0$ or $y=0$, but what about other cases when $g(x)$ is in fact a function of $x$?
That is, How to investigate the symmetry of $f(x)$ around $g(x)$?
Another question that crossed my mind when thinking of the first one was the case when $f(x)$ is not simply a single function, as in discussing whether two functions (say $v(x)$ and $s(x)$) formed a mirror image of each other around a third function (say $g(x)$) or not. The case again seems simple enough when $v(x) = inverse(s(x))$ , and $g(x)=x$. Although I know no test for that, but it is always the case that a function and its inverse are symmetric around $g(x)=x$. And, again, I can't think of a possible way to check for the symmetry of two separate curves about a third curve, or even generate a mirror image of a given curve about another given curve (you may consider that last sentence a third part of the question).
Instead of calling it the axis of symmetry, I will call it the function of symmetry. One of the characteristics of symmetry is that the function of symmetry must be an equal distance from both the original and mirror image. I suggest that we use lines perpendicular to the function of symmetry to define which points in the original and mirror image correspond to each other.
To find the slope of a function we calculate its derivative. $g'(x)$
To convert slope to perpendicular slope: $\frac{-1}{Slope}=\frac{-1}{g'(x)}$
Mirroring $f(x)$ over $g(x)$:
Consider mirroring the single point $(x, y)$ over $g(x)$.
Let $(a, g(a))$ equal the point on $g(x)$ at which the perpendicular line will cross.
The slope between those two points must equal the perpendicular slope. $$\frac{g(a)-y}{a-x}=\frac{-1}{g'(a)}$$ $$g'(a)(g(a)-y)=-1(a-x)$$ $$g'(a)g(a)-g'(a)y=x-a$$ If we were going to mirror the function $f(x)$, the equation would look like this: $$g'(a)g(a)-g'(a)f(x)=x-a$$ Let's use $g(x)=x^2$ and $f(x)=x$ as an example.
The slope at any point on $g(x)$ is $2x$. $g'(x)=2x$ $$2a*a^2-2a*x=x-a$$ $$2a^3-2ax=x-a$$ We must solve for $a$ to determine the perpendicular point on $g(x)$. Unfortunately, this cubic function is difficult to solve directly. There are ways to approximate. $$2a^3+a-2ax=x$$ $$2a^3+a(1-2x)=x$$ $$a^3+a\frac{(1-2x)}{2}=\frac{x}{2}$$ $$a^2+\frac{(1-2x)}{2}=\frac{x}{2a}$$ $$a^2=\frac{x}{2a}-\frac{(1-2x)}{2}$$ $$a^2=\frac{x}{2a}+\frac{(2x-1)}{2}$$ $$a^2=\frac{x}{2a}+x-\frac{1}{2}$$ $$a=\sqrt{\frac{x}{2a}+x-\frac{1}{2}}$$ To use this formula to approximate $a$, you can set $a$ equal to any number to start with (preferably a good guess). Plug the formula into itself many times. The formula will output a number closer to the true $a$ each time. Then calculate $g(a)$ to yield the point on $g(x)$ at which the perpendicular line will go through. $(a, g(a))$
To get the corresponding point on the mirror function we have to add the difference between the x and y components of the original point and the point on $g(x)$ to the point on $g(x)$. $$x_{new} = a+(a-x)$$ $$x_{new} = 2a-x$$ $$y_{new} = g(a)+(g(a)-f(x))$$ $$y_{new} = 2g(a)-f(x)$$ You can use this technique on several points on $f(x)$ to get the general shape of its mirror, but to get the equation for the mirror of $f(x)$ you would have to solve the cubic equation for $a$.
Detecting Symmetry:
Let $f(x)$ equal the function of symmetry.
Let $a(x)$ equal the original function.
Let $b(x)$ equal the mirror function.
Let $(x, f(x))$ equal the perpendicular point.
Let $(c, a(c))$ equal the original point.
Let $(d, b(d))$ equal the mirror point.
The x and y component differences must be equal between the mirror point and the other two points. $$c-x=x-d$$ $$c+d=2x$$ $$a(c)-f(x)=f(x)-b(d)$$ $$a(c)+b(d)=2f(x)$$ Starting with just the three functions, we do not know which points correlate. Begin with $(x, f(x))$ and go from there. Find the intersection between the perpendicular line and the original and mirror function. Then to check for symmetry, confirm the above equations.
$$\frac{f(x)-a(c)}{x-c}=\frac{-1}{f'(x)}$$ $$f'(x)(f(x)-a(c))=-1(x-c)$$ $$f'(x)f(x)-f'(x)a(c)=c-x$$ $$f'(x)a(c)+c=f'(x)f(x)+x$$ $$f'(x)b(d)+d=f'(x)f(x)+x$$ Solve for $c$ and $d$ as necessary.
As an example let's prove that a function and its inverse are mirrored over $f(x)=x$. $f'(x)=1$ $$a(c)=g(c)$$ $$b(d)=g^{-1}(d)$$ $$1*g(c)+c=1*x+x$$ $$g(c)+c=2x$$ $$g^{-1}(d)+d=2x$$ The equations to prove with what we have so far are: $$c+d=2x$$ $$g(c)+g^{-1}(d)=2x$$ The definition of an inverse could be said to be switching the $x$ and the $y$ values. That means: $$g(c)=d$$ $$g^{-1}(d)=c$$ Plugging those into the equations we get: $$c+d=2x$$ $$g(c)+g^{-1}(d)=2x$$ Therefore proven.
Creating a function of symmetry:
Using the equations in the last section: $$f'(x)a(c)+c=f'(x)f(x)+x$$ $$f'(x)b(d)+d=f'(x)f(x)+x$$ $$c+d=2x$$ $$a(c)+b(d)=2f(x)$$ $$f(x)=\frac{a(c)+b(d)}{2}$$ $$f(x)=\frac{a(c)}{2}+\frac{b(d)}{2}$$ $$f'(x)=\frac{a'(c)}{2}+\frac{b'(d)}{2}$$ $$(\frac{a'(c)}{2}+\frac{b'(d)}{2})a(c)+c=(\frac{a'(c)}{2}+\frac{b'(d)}{2})f(x)+x$$ $$(a'(c)+b'(d))\frac{a(c)}{2}+c=(a'(c)+b'(d))\frac{f(x)}{2}+x$$ $$(a'(c)+b'(d))a(c)+2c=(a'(c)+b'(d))f(x)+2x$$ $$(a'(c)+b'(d))f(x)=(a'(c)+b'(d))a(c)+2c-2x$$ $$f(x)=a(c)+\frac{2c-2x}{a'(c)+b'(d)}$$ $$f(x)=b(d)+\frac{2d-2x}{a'(c)+b'(d)}$$ $$a(c)+\frac{2c-2x}{a'(c)+b'(d)}=b(d)+\frac{2d-2x}{a'(c)+b'(d)}$$ $$a(c)(a'(c)+b'(d))+2c-2x=b(d)(a'(c)+b'(d))+2d-2x$$ $$a(c)(a'(c)+b'(d))+2c=b(d)(a'(c)+b'(d))+2d$$ Now we have a relation that we can use to determine corresponding points.
Lets use $a(x)=x^2$ and $b(x)=x$ as an example. $a'(x)=2x$ $b'(x)=1$ $$c^2(2c+1)+2c=d(2c+1)+2d$$ $$2c^3+c^2+2c=2cd+d+2d$$ $$2c^3+c^2+2c=2cd+3d$$ $$2c^3+c^2+2c=d(2c+3)$$ $$d=\frac{2c^3+c^2+2c}{2c+3}$$ The point $(x, f(x))$ must be at the midpoint of $(c, a(c))$ and $(d, b(d))$. $$f(x)=\frac{a(c)+b(d)}{2}$$ $$f(x)=\frac{c^2+d}{2}$$ $$f(x)=\frac{c^2+\frac{2c^3+c^2+2c}{2c+3}}{2}$$ $$x=\frac{c+d}{2}$$ $$x=\frac{c+\frac{2c^3+c^2+2c}{2c+3}}{2}$$ Our goal should be to get $f(x)$ in terms of $x$. $$2x=c+\frac{2c^3+c^2+2c}{2c+3}$$ $$2x-c=\frac{2c^3+c^2+2c}{2c+3}$$ $$f(x)=\frac{c^2+2x-c}{2}$$ $$f(x)=x+\frac{c^2-c}{2}$$ Now we would need to solve for $c$ directly to solve for the function of symmetry, however it is a cubic and hard to solve for: $$2x-c=\frac{2c^3+c^2+2c}{2c+3}$$ You can use a method of approximation like the one I used earlier to find points along the function of symmetry, but to find the equation you would have to solve directly. $$(2x-c)(2c+3)=2c^3+c^2+2c$$ $$4xc+6x-2c^2-3c=2c^3+c^2+2c$$ $$2c^3+3c^2+5c-4xc=6x$$ $$2c^2+3c+5-4x=\frac{6x}{c}$$ $$c^2+\frac{3c}{2}+\frac{5}{2}-2x=\frac{3x}{c}$$ $$c^2+\frac{3c}{2}=\frac{3x}{c}+2x-\frac{5}{2}$$ $$c^2+\frac{3c}{2}+(\frac{3}{4})^2=\frac{3x}{c}+2x-\frac{5}{2}+(\frac{3}{4})^2$$ $$(c+\frac{3}{4})^2=\frac{3x}{c}+2x-\frac{5}{2}+\frac{9}{16}$$ $$c+\frac{3}{4}=\sqrt{\frac{3x}{c}+2x-\frac{40}{16}+\frac{9}{16}}$$ $$c=\frac{-3}{4}+\sqrt{\frac{3x}{c}+2x-\frac{31}{16}}$$ Condensed Summary: $$a(c)(a'(c)+b'(2x-c))+4c=b(2x-c)(a'(c)+b'(2x-c))+4x$$ Solve for $c$ and plug $c$ into $$f(x)=x+\frac{c^2-c}{2}$$ This can also be used as a method of detecting symmetry.