a1 = a2
a1 = F/(M+m1+m2) | Force/(Mass of entire system) = acceleration of entire system
*a2 = (m1g)/(m2+m1) | Force = m1g; acceleration of m2 and m1 = m1g/(m1+m2)
My answer: F = (m1g)(M+m1+m2)/(m2+m1)
The book's answer: F = (m1g)(M+m1+m2)/(m2)
*This step is what leads me to a slight variation...