ok ... that was confusing ... maybe you're helping someone else with their homework ?
the moment in the beam is easy to calculate ...
assuming simply supported, length "L", then end reactions are (w*a)/2 ... where "a" = the length of the distributed load "w"
then define "b" = (L-a)/2 the unloaded length at each end of the load, yes?
then for x<b, M = Rx = (wa/2)*x
and for b<x<a/2, M = Rx-w(x-b)*(x-b)/2 ... Mmax(x=L/2) = RL/2-w(L/2-b)(L/2-b)/2 = waL/4-w*a/2*a/4
and the stress = My/I = M(d/2)/(pi*d^4/64) = 32M/(pi*d^3)
Quando Omni Flunkus Moritati