Let side of the square ABCD=n, therefore, AB=AC=n.
Let AngleBAP=x.
For triangle BAP, using cosine rule:
2^2 = n^2 +1^2 - 2(1)(n)cosx..........................(1)
For triangle PAC again using cosine rule:
3^2= 1^2 + n^2 -2(1)(n)cos(90-x) (since angle BAC is a rt-angle.)
or 3^2 = 1^2 +n^2 -2(1)(n)sinx........................(2)
From (1), we get 2ncosx =n^2-3................(3)
From (2), we get 2nsinx = n^2 -8................(4)
Therefore, (2ncosx)^2 + (2nsinx)^2 = (n^2-3)^2 + (n^2 -8)^2
4n^2 = n^4 -6n^2 +9 + n^4 -16n^2 + 64
2n^4 -26n^2 +73 = 0
Solving the quadratic equation we get n^2=8.898 or 4.102, that is side of the square n=2.983 or 2.025(reject because it cannot accomodate PC=3)
Again applying cosine rule to triangleBAP, therefore,
n^2 = 2^2 + 1^2 -2(2)(1) cos(angle APB)=8.898
therefore, angle APB=cos^-1[(5-8.898)/4] = 167 degree.
However, from your diagram, I think you mean PD=3 instead of PC=3. In such a case, consider rotating triangle BPD about point B through 270 º counterclockwise, we get D coincide with A and P goes to Q.
Now, draw the line PQ and we have
BP=BQ=2
∠PBQ=∠PBA+∠ABQ=∠PBA+∠DBP=∠DBA=90 º
Therefore,
PQ=√(2²+2²)=√8
∠QPB)=(180-90)/2=45 º
As AP²+PQ²=1+8=9=AQ², by the Pythagorean theorem, we have