Find the slope of a line perpendiculat to the line y=1/2x+7

Pretty easy. Use the fact that the product of the first derivatives of linear functions and their perpendiculars respectively are always -1.

This is:
m'=-1/(1/2)=-2
Since we can choose an arbitrary function with the imposed properties, it suffices to take
g(x)=-2*x
q.e.d.

To find the slope of a line perpendicular to a given line, you need to determine the negative reciprocal of the slope of the given line.

In the given line equation y = 1/2x + 7, the slope is 1/2. To find the slope of a line perpendicular to this line, you need to take the negative reciprocal, which means you flip the fraction and change the sign.

The negative reciprocal of 1/2 is -2/1, which simplifies to -2. Therefore, the slope of a line perpendicular to the line y = 1/2x + 7 is -2.