\documentclass[a4paper]{article}
\usepackage{bbm}
\title{Tangent graph intersecting at right angle}
\author{Rik Snel}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{fp}
\usepackage{amsmath}
\usepackage{a4wide}
\input{vec2d}
\parindent0pt
\parskip .5ex
\begin{document}
\maketitle

\section{Example 1}

We start with $f(x) = x^2$ and $\displaystyle g(x) = \frac{a}{x} + b$. By fixing the discriminant of $f(x) = g(x)$ we ensure that $f(x)$ and $g(x)$ are tangent in a point.
The discriminant of $x^2+px+q= 0$ is $-4p^3 -27q^2$. So in our case we have $D = 4b^3 - 27a^2$ which we want to be equal to zero which gives $a = \frac29 \sqrt{3} \cdot b\sqrt{b}$.

Now the solutions of $f(x) = g(x)$ are $x = \frac23\sqrt{3b}$ and $x = -\frac13\sqrt{3b}$. The multiplicity of the latter solution is two, so thats where the tangent point appears.

For the graphs to intersect at a right angle in the other point
\[
	f'(\frac{_2}{^3}\sqrt{3b})\cdot g'(\frac{_2}{^3}\sqrt{3b}) = -1
\]
must hold. This gives $b = 1\frac12$ and thus $a = \frac12\sqrt{2}$.

So we have $f(x) = x^2$ and $g(x) = \frac{\sqrt{2}}{2x} + 1\frac12$.

\VDDdef O(0,0)X(1,0)Y(0,1)U(-4,-3)W(4,3)
\VDDdcanvas 1:1
  \VDDdeflinepoint x:OX
  \VDDdeflinepoint y:OY
  \VDDdwholeline xy
  \psplot[plotpoints=400]{-5}{5}{x x mul}%
  \psplot[plotpoints=400]{-5}{-0.1}{1 2 sqrt x mul div 1.5 add}%
  \psplot[plotpoints=400]{0.1}{5}{1 2 sqrt x mul div 1.5 add}%
  \VDDllinelinepointletter xy:OW:1:1
  \VDDllineedgeletter x:W:1:1
  \VDDllineedgeletter y:W:-1:1 
\VDDdcanvasend


\break

\section{Example 2}

Now we start with $f(x) = x^3 - ax$ and $g(x) = cx + d$. Using the discrimimant of $f(x) = g(x)$ we find $d = \frac29\sqrt{3}(a+c)\sqrt{a+c}$. The solutions of $f(x) = g(x)$ are
$x = \frac23\sqrt{3(a+c)}$ and $x = -\frac13\sqrt{3(a+c)}$. Compare with example 1. The tangent point is at the latter solution. 

For the graphs to intersect at a right angle in the other point
\[
	f'(\frac{_2}{^3}\sqrt{3b})\cdot g'(\frac{_2}{^3}\sqrt{3b}) = -1
\]
must hold. This gives $\displaystyle c = \frac{-3a\pm \sqrt{9a^2 - 16}}{8}$. We are somewhat free in our choice of $a$. Let's choose $a$ such that $9a^2 - 16 = 0$. Then we have
$a = \frac43$, $c = -\frac12$ and $d = \frac5{54}\sqrt{10}$.

So we have $f(x) = x^3 - \frac43x$ and $g(x) = -\frac12x + \frac5{54}\sqrt{10}$.

\VDDdef O(0,0)X(1,0)Y(0,1)U(-4,-3)W(4,3)
\VDDdcanvas 1:1
  \VDDdeflinepoint x:OX
  \VDDdeflinepoint y:OY
  \VDDdwholeline xy
  \psplot[plotpoints=400]{-5}{5}{x x x mul mul 4 3 div x mul sub}%
  \psplot[plotpoints=400]{-5}{5}{-.5 x mul 5 54 div 10 sqrt mul add}%
  \VDDllinelinepointletter xy:OW:1:1
  \VDDllineedgeletter x:W:1:1
  \VDDllineedgeletter y:W:-1:1 
\VDDdcanvasend


\end{document}
