notice the picture
we know DE, or the whole segment is 10x-12
and P is the midpoint
so.. the point P is cutting DE in two equal halves,
namely, DP and PE
so... whatever 10x-12 is, DP is half of that
thus
[tex]\bf DP=\cfrac{DE}{2}\implies 3x+2=\cfrac{10x-12}{2}[/tex]
solve for "x",
how long is DP? well, once you get "x", plug it in 3x+2,
that's how long DP is :)