Given that the equation x(x-2p)=q(x-p) has real roots for all real values of p and q. If q=3, find a non-zero value for p so that the roots are rational.

x(x-2p)=3(x-p)

x^2-2px = 3x-3p
x^2-(2p+3) + 3p = 0

for rational roots, the discriminant must be a perfect square. That is,

(2p+3)^2-12p
= 4p^2+12p+9-12p
= 4p^2+9
must be a perfect square.
p=2 is one solution

check:
x(x-4) = 3(x-2)
x^2-7x+6 = 0
(x-1)(x-6) = 0
Not only rational, but integers!

To find a non-zero value for p such that the roots of the equation are rational, we need to consider the discriminant. The discriminant of a quadratic equation of the form ax^2 + bx + c = 0 is given by the expression b^2 - 4ac.

Given the equation x(x-2p)=q(x-p), we can expand it to get x^2 - 2px = qx - pq.
Rearranging terms, we have x^2 - (2p+q)x + pq = 0.

Comparing this with the general quadratic equation form ax^2 + bx + c = 0, we have:
a = 1, b = -(2p+q), c = pq.

To ensure the roots are rational, the discriminant, b^2 - 4ac, must be a perfect square. In this case, b = -(2p+q). Squaring it, we get (2p+q)^2.

Now, let's substitute q = 3 into the equation and simplify:
b^2 - 4ac = (-(2p+3))^2 - 4(1)(p*3).
Expanding and simplifying further, we have:
(2p+3)^2 - 12p = 4p^2 + 12p + 9 - 12p = 4p^2 + 9.

We want 4p^2 + 9 to be a perfect square. For that to happen, we can equate it to (k)^2, where k is an integer.

Therefore, we have the equation: 4p^2 + 9 = k^2.

To find a non-zero value for p, we need to find an integer value for k, such that k^2 - 9 is divisible by 4.

One possible value for k is 5. Substituting k = 5 into the equation, we have:
4p^2 + 9 = 25.
Simplifying further, we get: 4p^2 = 16.
Dividing both sides by 4, we have:
p^2 = 4.
Taking the square root of both sides, we obtain:
p = ±2.

So, a non-zero value for p that satisfies the given conditions and makes the roots of the equation rational is p = 2.