# Convex conjugate of $f(x) = \langle a, x \rangle -b$

I don't quite understand how to get the convex conjugate of a function.

Wikipedia says the following

The convex conjugate of an affine function $$f(x) = \left\langle a,x \right\rangle - b,\, a \in \mathbb{R}^n, b \in \mathbb{R}$$ is $$f^\star\left(x^{*} \right) = \begin{cases} b, & x^{*} = a \\ +\infty, & x^{*} \ne a. \end{cases}$$

But why does the $+\infty$ appear there?

So I know the definition of the convex conjugate $f^*$:

$$f^*(x^*) = \sup_{x \in \mathbb{R}^n} \ \langle x^*, x \rangle -f(x)$$

then I found the derrivative ${f^*}'$

$${f^*}'(x^*) = x^* - a$$,

so my solution would be

$$f^*(x^*) = b$$

Can someone shed light into this?

Applying the definition, if $f(x) = \langle a,x \rangle - b$, then $$f^*(x^*) = \sup_{x \in \mathbb R^n} \Big(\langle x^*, x\rangle - \langle a,x \rangle + b\Big) = b + \sup_{x \in \mathbb R^n} \langle x^*-a, x\rangle.$$ In the case when $x^* = a$, this is just $b + \sup_{x \in \mathbb{R}^n} 0 = b$. But if $x^* \ne a$, we can choose $x$ in the sup to be $C(x^* - a)$ for any $C$. Therefore $$f^*(x^*) \ge b + \langle x^* - a, C(x^* - a)\rangle = b + C\|x^*-a\|_2^2.$$ Since $\|x^*-a\|_2^2 > 0$, we can make this lower bound on $f^*$ as high as we like by choosing very very large $C$, so $f^*(x^*) = +\infty$.