Let's assume that the longer candle shorten at rate of x cm/hr when burning and the smaller candle shorter at rate of y cm/hr.
Given, the longer candle burns out completely in 6 hours and the smaller candle in 4 hours,
So, their lengths are 6x cm and 4y cm respectively.
According to first condition,
⇒ 6x = 4y + 3
⇒ 6x - 4y = 3 .....(i)
At 9:30 p.m. length of longer candle = (6x - 4x) = 2x cm.
At 9:30 p.m. the length of smaller candle = $4y - \frac{5y}{2} = \frac{8y - 5y}{2} = \frac{3y}{2}$
Now, according to second condition given in problem,
2x = $\frac{3y}{2}$ (As both candles have same length at 9:30 p.m.)
⇒ 4x = 3y
4x - 3y = 0 ......(ii)
Multiplying (i) by 3 and (ii) by 4 we get,
18x - 12y = 9 .......(iii)
16x - 12y = 0 .......(iv)
Subtracting (iv) from (iii) we get,
⇒ 18x - 12y - (16x - 12y) = 9 - 0
⇒ 2x = 9
⇒ x = $\frac{9}{2}$ = 4.5 cm/hr.
On substituting value of x in (ii) we get,
4x - 3y = 0
4(4.5) - 3y = 0
18 - 3y = 0
3y = 18
y = 6 cm/hr.
Length of longer candle = 6x = 6(4.5) = 27 cm.
Length of smaller candle = 4y = 4(6) = 24 cm.
Hence, length of longer candle = 27 cm and length of smaller candle = 24 cm.