From homogeneous to non-homogeneous linear recurrence relation I'm trying to do the following exercise:
Find a non-homogeneous recurrence relation for the sequence whose general term is
$$a_n = \frac{1}{2}3^n - \frac{2}{5} 7^n$$
From this expression we can obtain the roots of the characteristic polynomial $P(x)$, which are $3$ and $7$, so $P(x) = x^2 - 10x + 21$ and $a_n = 10a_{n-1} - 21a_{n-2} \; \forall \; n \ge 2, \; a_0 = \frac {1}{10}, \; a_1 = -\frac{13}{10}$.
Now I don't know how to obtain a non-homogeneous recurrence relation given this homogeneous recurrence relation.

Just start with your favorite term containing $a_n$ and $a_{n-1}$, say
$a_n - a_{n-1}$, calculate the difference, here
$$ a_n - a_{n-1} = \frac 12 3^n - \frac 25 7^n - \frac 12 3^{n-1} + \frac 25 7^{n-1} $$
giving you the inhomogeneous recurrence
$$ a_n = a_{n-1} + \frac 12 3^n - \frac 25 7^n - \frac 12 3^{n-1} + \frac 25 7^{n-1}, \quad n \ge 1 $$
