added algebriac solution to problem 3