Yes, this code is not easy and I don't have an easy answer for you. Only a couple tips.
The problem is not complexity, the problem is that the code is too long and overwhelming.
First of all, you have too many nested control blocks but you already know that. For instance the opening starts at line 4:
if (kryptonDataGridView2.SelectedRows.Count > 0)
I have gone through all the code, this is a part of a single function that seems to be handling an event in the user interface, possibly a selection event on a data grid.
There are 450 lines of code and that is way too much for a single function. A general rule in current programming is that any function larger than one screen in an editor is too ...
It's great that you have included unit tests for these functions. That makes reviewing and proposing modifications much easier than otherwise. Thank you!
It's normal to write header files for inclusion with a name ending in .h. MathLibrary.cpp is likely to be mistaken for the top level of a translation unit (aka an implementation file).