p { margin-bottom: 0.25cm; line-height: 120%; }
Dear Student, please see the diagram below.

Let,
x1 = distance of block A from wall
x2 = distance of block B from pulley
L = length of the string.
a = magnitude of acceleration of the block A with respect to ground
b = magnitude of acceleration of the block B with respect to block A
θ = angle of the inclination of the plane.
Then x1 + x2 = L
Differentiating twice with respect to time,
we get

Now from FBD of block B (from the reference frame of block A),
we have following forces acting on B,
N = normal reaction
mBg = gravitational force
mBa = pseudo force
as shown in the figure.
Writing Newton's second law along the plane, we get
mBb = mBacosθ + mBgsinθ
b = acosθ + gsinθ

