Q:

How to find the shear stress and bending moments of uninform distributed load

I can't for the life of me find a way to solve this.
Given is the length of a T girder, which is fixed at one and on rolled support on the other side
Now in the exercises given during class there would be a point load and a evenly distributed one, so making the shear force diagram is easy, calculate Ma and then subtract the point load once you reach it, and for the distributed load divide its force by the length of impact and subtract this for every meter and connect the dots.
For bending moments I integrate the shear force by calculating the area under the curve. Worked fine but
On the exam there where a point load, an even distributed load and an uneven distributed load on top of the distributed one. Problem is I can't use the area method since the shear force is a curve when uneven distributed. In theory I could use Simpson rule but I don't know how to find the exact values of the shear force curve. 
Normal I calculate its value at the end of every meter, and connect the dots. 
Would someone help me by explaining the "proper" way to calculate it? The exam was a massacre, you'd help more than one student 

A:

It seems like you are stuck on handling the non-uniform load distribution. I will just focus on this, then you can just add the contributions from the point and uniform distributions on top of this since you said you know how to handle these. I will be looking at what you have stated in the comments: 

Length of beam 12 m. Uneven distributed load starts at 4 meters with 0 kN/m and ends at 8 meters with 4 kN/m

Therefore, assuming the load varies linearly with distance between the specified end points, the distributed load is given by 
$$w(x)=(1\space \frac{kN}{m^2})x\space -\space (4 \space \frac{kN}{m})$$
when $4\space m<x<8\space m$, and is $0$ otherwise. Also, $x=0\space m$ corresponds to the left end of the beam, and increases to the right.
The first thing we need to do is determine the boundary conditions. This can be done by resolving the distributed load to a point load at the centroid of the distribution. 
The total force is given by (dropping units on constants):
$$F_P=\int_0^L w(x)dx=\int_4^8(x-4)dx=8\space kN$$
which is just the "area" under the distributed load.
The location of this force is given by the centroid:
$$\bar x=\frac{\int_0^L xw(x)dx}{\int_0^L w(x)dx}=\frac{\int_4^8 (x^2-4x)dx}{8\space kN}=\frac {20}{3}\space m \approx 6.67 \space m$$
So we have resolved this distribution to a point force of $F_P=8\space kN$ at position $\bar x=6.67\space m$ from the left end of the beam. Next we need to determine the shear forces at the boundaries of our beam. This is where this point load we calculated comes into play, and it becomes a simple statics problem.
Let's call the force on the left end of the beam $F_L$. We must have no net torque about the right end of the beam, so $-F_L(12\space m)+F_P(12\space m - 6.67 \space m)=0$ Therefore, it must be that
$$F_L=\frac{(8 kN)(5.33 \space m)}{12\space m}\approx 3.56\space kN=-Q(0)$$
I have included the negative sign since the shear force will be negative at the left end of the beam.
We are done with the resolved point load and we need to consider the actual distributed load now. The shear force will be
$$Q(x)=\int_0^x w(x')dx'+Q(0)$$
This then means that for $x<4\space m$, 
$$Q(x)=Q(0)=-3.56\space kN$$
For $4\space m<x<8\space m$, we have
$$Q(x)=\int_4^x (x'-4)dx'-3.56\space kN=\left [\frac 12 (x-4)^2\right ] kN-3.56\space kN$$
And for $x>8\space m$ we have
$$Q(x)=\left [\frac 12 (8-4)^2\right ] kN-3.56\space kN=4.44 \space kN$$
Note: I have been a little sloppy in my inclusion of units in the above derivation, but if you are more careful with everything then it all works out.
Below is a graph of this function is below (the picture is not loading for now, but I will keep on trying). Also, we see that $3.56\space kN + 4.46\space kN=8 \space kN$ so that the net force on the beam is $0$ (which is what we want).
To get the bending moment, you can do what you explained in your question:
$$M(x)=\int_0^x Q(x')dx'$$
which is very similar to what we just walked through. As a check, we also find (if we don't round the numbers like I do above) that $M(0)=M(12)=0\space kN \cdot m$ , which is what we want due to the boundary conditions of the beam.
You can then take this along with your solutions of the point and uniform loads that you say you know how to do and add them all together, since the differential equations here are linear. Also notice that I put in the general formulas before applying them to the specific problem, so you should now be able to handle any type of non-uniform load, not just this triangular one. Let me know in the comments if you have any other questions.

