Ok, so I am trying to make a program that can find the time of a car when two cars are speeding away from each other at a certain speed, each with a different rate that is only given the rate using time=distance/rate. But I would need a expression with a unsolved, variable, to do problems like the following:
Car1 is going 20mph. Car2 is going 10mph faster than Car1. Car2 left one hour later than Car1. How long would it take Car2 to catch up with Car1?
And my work without a program:
t = Travel time total (in hours)
10*t = 20(t-1) # Note the 1 is for the 1 hour
# rearrange
10*t = 20*t - 20
# subtract 10*t from both sizes
0 = 10*t - 20
# add 20 to both sides
20 = 10*t
#divide both sizes by 10
2 = t
Is there a module that supports operations with undefined variables using the distributive property (i.e. which can solve equations like this one)?
If not, than could I have a small example of how I would use unidentified variables without a module? I just went over this in school.