Answer: 6 hours
======================================
Step-by-step explanation:
x = number of hours that pass by
y = height of candle in cm
candle A is 50 cm tall at the starting time x = 0. So (x,y) = (0,50) is the y intercept and one point on the line.
Candle A burns for 3 hours. So x = 3 and y = 0 pair up giving (x,y) = (3,0) as the second point.
Let's find the slope of the line through the two points (0,50) and (3,0)
m = (y2-y1)/(x2-x1)
m = (0-50)/(3-0)
m = -50/3
The equation for candle A's height is
y = (-50/3)x+50
--------------------
Candle B has the two points (0,70) and (6,0) on its equation line. The same kind of logic applies as it does with candle A, just the numbers are different now.
Find the slope
m = (y2-y1)/(x2-x1)
m = (0-70)/(6-0)
m = -70/6
m = -35/3
The equation for candle B's height is
y = mx+b
y = (-35/3)x+70
--------------------
The equations for the heights of candle A and candle B are
y = (-50/3)x+50
y = (-35/3)x+70
Solve this system of equation to find the (x,y) ordered pair solution. I'm going to use substitution here.
--------------------
y = (-50/3)x+50
(-35/3)x+70 = (-50/3)x+50
3*((-35/3)x+70) = 3*((-50/3)x+50)...multiply both sides by 3
3*(-35/3)x+3*70 = 3*(-50/3)x+3*50
-35x+210 = -50x+150
-35x+50x = 150-210
15x = -60
x = -60/15
x = -4
A negative time value makes no sense, so this means that the two candles are never the same height at the exact same time if we ignore heights of 0. If we include heights of 0, then the two candles will be the same height from hour x = 6 and onward. This is basically when both candles are completely burned out. So its likely your teacher is going for this result even though we got a negative x solution.
See the graph below for a visual representation.