private void btnderAnalytic_Click(object sender, EventArgs e)
        {
            try
            {
                pv1.Model.InvalidatePlot(true);
                string input = tbInput.Text.Trim(' ');
                b.RootFunc = b.Insert(ref input);
                b.GenerateTextFile(b.RootFunc.GetDerivativeAnalytically());
                tbResult.Text = b.ParseToString(b.RootFunc.GetDerivativeAnalytically());
                pv1.Model.Series.Add(b.GetFunctionSerieForDerivativeAnalytically());

                Process dot = new Process();
                dot.StartInfo.FileName  = "dot.exe";
                dot.StartInfo.Arguments = "-Tpng -oabc.png " + "functions.dot";
                dot.Start();
                dot.WaitForExit();
                Process photoViewer = new Process();
                photoViewer.StartInfo.FileName = @"abc.png";
                photoViewer.Start();
                //TreeOtherOper.ImageLocation = "abc.png";
            }
            catch (FormatException)
            {
                MessageBox.Show("Please input the correct format!");
            }
            catch (UnAcceptedDegreeForPowerException u)
            {
                MessageBox.Show(u.Message);
            }
            catch (UnacceptedFunctionForFactorialException u)
            {
                MessageBox.Show(u.Message);
            }
        }
 private void btnPlot_Click(object sender, EventArgs e)
 {
     try
     {
         string input = tbInput.Text.Trim(' ');
         b.RootFunc = b.Insert(ref input);
         if (rbMainFunction.Checked)
         {
             pv1.Model.Series.Add(b.GetFunctionSerieMainFunction());
         }
         else if (rbDerAnalytically.Checked)
         {
             pv1.Model.Series.Add(b.GetFunctionSerieForDerivativeAnalytically());
         }
         else if (rbDerivativeNewton.Checked)
         {
             pv1.Model.Series.Add(b.GetFunctionSerieForDerivativeNewton());
         }
         else if (rbIntegral.Checked)
         {
             pv1.Model.Series.Add(b.GetFunctionSerieIntegral(Convert.ToDouble(tbLowerBound.Text), Convert.ToDouble(tbUpperBound.Text), ref result));
             MessageBox.Show(result.ToString());
         }
         else if (rbMcLaurinSerie.Checked)
         {
             for (int i = 1; i < 9; i++)
             {
                 pv1.Model.Series.Add(b.GetFunctionSeriesMcLaurinSeries(i));
             }
         }
     }
     catch (UnAcceptedDegreeForPowerException u)
     {
         MessageBox.Show(u.Message);
     }
     catch (UnacceptedFunctionForFactorialException u)
     {
         MessageBox.Show(u.Message);
     }
     catch (Denominator0Exception d)
     {
         MessageBox.Show(d.Message);
     }
     catch (IndexOutOfRangeException)
     {
         MessageBox.Show("Please input the correct format!");
     }
     catch (FormatException)
     {
         MessageBox.Show("Please input the correct format!");
     }
 }