We had succes integrating
wvWare into our forthcoming knowldedge management system. You can see wvWare in action at
FreeViewer.com.
As for displaying mathematical functions, I would suggest that you start exploring the wide and wonderful world of LaTeX. There are several LaTeX to html converters that produce passable representation of math content. Search for LaTeX on google for more information. LaTeX is another document markup language based on free tools, I'll warn you though that full mastery can take a lifetime.
Cheers,