Integrating factor in optimal control theory

Hey guys,

This is an optimal control problem for an econ class but it is the maths behind it I am struggling with - so have left the context out. I have derived two differential equations in my state and costate variables:

costate:

state:

where is some arbitrary constant.

Now i need to solve for

Using the integrating factor I get:

Where is another arbitrary constant. Is this right?

I then have to apply the transversality condition:

Which using my solutions for and is:

I won't go any further with the problem here because I am convinced I have gone wrong somewhere since the equation isn't very pretty :( can anyone check my value for please?