If I understand your question correctly you are looking for the equation of the tangent line which passes through Q(q, 0) and has P as the tangent point.

If so:

1. All lines passing through Q have the equation: y = m (x -q)

2. Determine the Points of intersection between the line and the ellipse:

x^2/a^2 + (m(x-q))^2/b^2 = 1

DSolve for x.

3. To get a tangent point the discriminant must be zero. And this is the additional condition to find the tangent line.