# Comparing a linear function and a rational quadratic function

I'm given two functions:

$$f(x) = \frac {x^2 A + (1 - x)^2 B }{x^2 + (1-x)^2}$$ $$g(x) = xA + (1 - x) B$$

A and B are greater than 0. In the interval $$[0,1]$$, I should find when $$f(x) > g(x)$$ and when $$f(x) < g(x)$$.

How should I approach this problem? My first issue is that the solution will obviously depend on the value of A and B. For example, if A and B are both 1, f(x) is constant at 1. And g(x) is also constant at 1.

## 1 Answer

Hint: I would compute $$f(x)-g(x)?=\frac{Ax^2+(1-x)^2B}{x^2+(1-x)^2}-Ax-(1-x)B=\frac{(x-1) x (2 x-1) (B-A)}{2 x^2-2 x+1}$$