This is truly some industrial strength algebra. I got the first one down fairly simple, but couldn't manipulate the last term to very much. Maybe it's stated incorrectly or something.
I messed around with this last term a while, but could never get it to anything simpler than it already is.
Now, for the second one.