We know that a straight line has a general formula: y = mx+c, where m is the gradient of the line and c is the y-intercept; so, we are looking to find m and c.
The line passes through the point (0,3) so x=0 and y = 3; thus, we substitute
3 = m * 0 + c;
c = 3;
so, y = mx+3;
If y = mx+3 and y = 2x are perpendicuar, we know that the gradients of the 2 lines are negative reciprocals to each other and we can write m as:
m = -1/2;
Hence, y = -1/2x+3