I tried to do it but I am sure that's completly wrong ....

1. Two graphs have gradient functions dy/dx = 3x^2+3x+a and dy/dx = 3x^2-2x+1. The graphs cross at the point (1, a) and also at the point where x=-2.

Find the equations of the two graphs, and the value of a.