Diane runs 25 km in y hours,

So her average speed is \frac{25}{y} km/hr.

Ed walks 22 km in (y +3) hours,

which means his average speed is \frac{22}{y+3} km/hr.

Ed walks at an average speed of 6 km/hr less than Diane's average speed

so \frac{22}{y+3} = \frac{25}{y}-6

Multiplying all terms by y(y+3)

\frac{22}{y+3} \times y(y+3) = \frac{25}{y} \times y(y+3) - 6 \times y(y+3)

\Rightarrow 22y = 25(y+3) - 6y(y+3)

\Rightarrow 22y = 25y + 75 - 6y^{2} -18 y

\Rightarrow 6y^{2} + 15y - 75 = 0

\Rightarrow 2y^{2} + 5y - 25 = 0

\Rightarrow (2y-5)(y+5) = 0

\Rightarrow y = 2.5 or y = -5

But y cannot be a negative value so y = 2.5 hours.