Solving for a 3 DOF planar manipulator...

TF = TraditionalForm;
FS = FullSimplify;

Enter DH parameters

humanDH = {{0, 0, 0, θ1, 0}, {0,  L1,  0,  θ2,  
          0}, {0,  L2,  0,  θ3,  0}}

Tori  =  {{R11,  R12,  R12,  PX}, {R21,  R22,  R23,  
            PY}, {R31,  R32,  R33,  PZ}, {0, 0, 0, 1}};

Set up orientation and position of end effector

Tori // TF

Solve forward kinematics

HumanT03 = T[humanDH,  0,  3]; HumanT03 // TF // FS

Solve for θ2

eq2a = Tori[[1, 4]] == HumanT03[[1, 4]]; eq2a // FS // 
      TF

eq2b = Tori[[2, 4]] == HumanT03[[2, 4]]; eq2b // FS // 
      TF

eq2c = 
      Tori[[1, 4]]^2 + Tori[[2, 4]]^2 == 
        HumanT03[[1, 4]]^2 + HumanT03[[2, 4]]^2; eq2c // FS // 
      TF

Solving for cos(θ2) we get...

eq2d = 
      Cos[θ2] == (PX^2 + PY^2  -  L1^2 - L2^2)/(2*L1*
              L2); eq2d // FS // TF

And using the following trig identity

We get the following closed form solution for θ2...

So, θ2 = Atan2(+-({{\(\@\(1 - \((\(\(-L1\^2\) - L2\^2 + PX\^2 + PY\^2\)\/\(2\ L1\ L2\))\)\^2\)\), ,((-(L1^2) - (L2^2) + (PX^2) + 
                          (PY^2))/(2 L1 L2))}}))

Solve for θ1 (taken from Craig, p.124-125)

θ1=Atan2(PY, PX) – Atan2[L2 sin(θ2), L1+L2 cos(θ2)]

Solve for θ3

In terms of the given planar manipulator, a desired position vector is given as PX, PY, and ϕ, where ϕ is the given orientation.  Therefore, 

θ3 = Atan2[sin(ϕ), cos(ϕ)] – θ1 – θ2