No idea what you mean by widget...
SFML is not a GUI library, it only provides basic drawing function. So if you want to draw a function, just go ahead and use for instance a sf::VertexArray, define some points by running the math function and let it display.