# How to calculate Inertia tensor?

I'm trying to obtain dynamics of a 4 DOF robot. Firstly, I calculated all Transformation matrices and Jacobians. While solving Lagrangian there is a term I - Inertia tensor . I couldn't understand the formula and how it is applied to a link (Because I couldn't find any example of Finding inertia tensor for a link instead they are explaining with ordinary rectangular bar). I wanted to know how to find that Inertia tensor matrix ? So please someone help me