So I have had these questions confusing me for some time and tried googling but came up with long , hard-to-understand equations and notations and articles. So I would be glad if someone could clarify these things a bit more simpler.

I know (mass) moment of inertia = integrate(r^2) dm , where r is the perpendicular distance from the axis of rotation to the mass center of the elementary mass.

Product of inertia is the product of perpendicular distances to the same in two axis.
eg : Ixy, Ixz

What do we need to do to calculate principal moments of inertia. Does that mean finding Ixx, Iyy, Izz?

what do we need to do to find the direction of the principal axes? Does that mean finding the inertia matrix I,
( Ixx 0 0
I = 0 Iyy 0
0 0 Izz)

or?

Yes.

If you have an moment of inertia matrix that has off diagonal numbers then rotation about any of those axes will cause wobble like an unbalanced car wheel. Think about trying to spin a dumb bell around an axis 30 degrees off the one through the two weights at the ends. The trick is to rotate the axes of spin until the three axes of rotation line up with the principal moments of inertia. Perhaps what you are looking for is this:
https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix

Ah ha

Here is a more basic rationale and they even usee my dumb bell!

http://www.physics.arizona.edu/~varnes/Teaching/321Fall2004/Notes/Lecture34.pdf

To calculate the principal moments of inertia, you need to find the eigenvalues of the inertia matrix. Here's how you can do it:

1. Start with the inertia matrix I you mentioned:

[ Ixx 0 0 ]
I = [ 0 Iyy 0 ]
[ 0 0 Izz]

2. Compute the characteristic polynomial of I by subtracting a scalar λ from the diagonal elements of I and taking the determinant:

det(I - λI) = ( Ixx - λ )( Iyy - λ )( Izz - λ ) - 0 - 0

3. Set the determinant equal to zero and solve for λ. This will give you three values of λ, which are the eigenvalues of the inertia matrix.

( Ixx - λ )( Iyy - λ )( Izz - λ) = 0

4. The eigenvalues represent the principal moments of inertia along the principal axes. They indicate how the mass is distributed in space and how it resists rotation about each axis.

To find the direction of the principal axes, you also need to find the corresponding eigenvectors. Each eigenvector will represent the axis of rotation for each principal moment of inertia.

1. Once you have the eigenvalues λ1, λ2, and λ3, substitute each value back into the equation (I - λI) * v = 0, where v is the eigenvector.

2. Solve these three equations to find the eigenvectors v1, v2, and v3.

3. Normalize each eigenvector to have a unit length.

The resulting eigenvectors will give you the directions of the principal axes. Each eigenvector represents the direction in which the principal moments of inertia occur.

So, calculating the principal moments of inertia involves finding the eigenvalues of the inertia matrix, while determining the direction of the principal axes involves finding the corresponding eigenvectors.