There are people who like to write .NET applications. There are people who love computer algebra systems. In this article, Euler circles intersect!

Instead of intro
For scientific work it took complex mathematical calculations and drawing beautiful graphs. It is most logical to turn to such mathematical packages as
Mathematica ,
Matlab or to their free analogues. That, however, was done. But there was a need for a separate executable file for presentability and convenient change of input parameters.

')
I know that the packages sounded above have their own ways of compiling and developing the interface, but the .NET + Wolfram.NETLink combination has been chosen. What kind of animal is this?
Wolfram .NET / Link
Wolfram has a protocol for exchanging data between Mathematica and other programs -
MathLink . .NET / Link hides the low-level details of this process and allows the programmer to write high-level code under .NET. In short, this set of libraries allows you to send a request to the Mathematica kernel with one command and get an answer with another. You can write under MathLink itself, but already in C.
Of course, this miracle has its drawbacks. More precisely one. Although the library itself takes up only one file (Wolfram.NETLink.dll), the program without the Wolfram Mathematica pre-installed environment refuses to work. Of course, with the help of some shamanism, you can drag the core of Mathematica with the program, but this is unlikely to be legal.
Implementation
Acai First, take something simple for example. For example, finding the maximum of a quadratic function. And then display it on the function graph. In principle, this is enough to understand almost everything that is needed when working with the .NET / Link library. So, in the Wolfram Mathematica language, it will look like this:

I think everything is clear here without explanation. Now you can start the implementation. Let's create a new project in Visual Studio and add a link to the Wolfram.NETLink.dll library (depending on the version, I’m in
\ Mathematica \ 8.0 \ SystemFiles \ Links \ NETLink ):

Add the “MathKernel” component from the Wolfram.NETLink namespace to the toolbar:

If it is not listed, you must also provide a link to the library (through the "Overview").
Well, now we need to deal with the design of the form. We need a pictureBox (display graphics), textBox (maximum output) and button (to run computational processes):

It is also necessary to remember to add the “MathKernel” component to the form. By default, the “CaptureGraphics” property of this component is set to false. We need graphics, so invert the values ​​of this property.
Actually, it remains only to give instructions to the button:
mathKernel1.Compute("f[x_] := -0.75 x^2 - 6*x + 7.5;");
Well, the maximum function we have defined. Next, let's deal with the graphics:
pictureBox1.Image = null;
The result is visible in the following screenshot:

Fast, simple and beautiful.
Conclusion
I think .NET / Link can be a good tool for masters, graduate students and other scientists involved in science. Unfortunately, the main disadvantages - the high price of the Wolfram Mathematica and poor portability - can spoil the whole picture.
PS I hope you enjoyed my first post. I will be glad to answer questions. If you are interested in articles about Wolfram Mathematica, write!