Use the distributive property to expand the multiplication:
color(blue)2(p+1)=color(red)3(p-1)
color(blue)2*p+color(blue)2*1=color(red)3*p-color(red)3*1
2p+2=3p-3
2p+2color(blue)+color(blue)3=3p-3color(blue)+color(blue)3
2p+2color(blue)+color(blue)3=3pcolor(red)cancelcolor(black)(color(black)-3color(blue)+color(blue)3)
2p+2color(blue)+color(blue)3=3p
2p+5=3p
2p+5color(blue)-color(blue)(2p)=3pcolor(blue)-color(blue)(2p)
color(red)cancelcolor(black)(2p)+5color(red)cancelcolor(blue)(color(blue)-color(blue)(2p))=3pcolor(blue)-color(blue)(2p)
5=3pcolor(blue)-color(blue)(2p)
5=p
p=5
That's the solution. Hope this helped!