The sign convention used in the beam section is defined in the following illustrations. Notice that unlike some publications on this subject, the loading term P(x) points to the same direction as y-axis. Please refer to the Euler-Bernoulli beam theory for more details.
The loading P and deflection y directions indicated are positive
The bending moment M direction indicated is positive
The shear force V direction indicated is positive.