Integral of polynomials in Scilab

Asked

Viewed 112 times

0

How to discover the integral of a polynomial expression in ?

I have that code:

clc;
clear;

x=poly(0,"x");
printf("Digite a expressão para calcular:");
 mfun=input("");
printf("MENU DE OPÇÕES\n");
printf("1-DERIVADA\n");
printf("2-INTEGRAL\n");
printf("3-MAX E MIN RELATIVOS\n");
printf("4-EXTREMOS\n");
printf("5-DOMINIO\n");
printf("6-IMAGEM\n");
printf("0-SAIR\n");
opcao=input("Digite um numero:");

    if(opcao==0) then
        printf("\nVocê optou por sair do programa!");
end
while(opcao<>0 )


select opcao




case 1 then
    if(i==0) then
       z=derivat(mfun);
       i=i+1;
   end
     if(i<>0)then 
         z=derivat(z);
         end
       disp(z);

    case 2 then
        printf("INTEGRAL");

    case 3 then
    printf("MAX MIN");

    case 4 then
    printf("EXTREMOS");


    case 5 then
        printf("DOMINIO");

    case 6 then
        printf("A imagem de sua função é: %d",opcao);





end
    printf("\n MENU DE OPÇÕES\n");
    printf("1-DERIVADA\n");
    printf("2-INTEGRAL\n");
    printf("3-MAX E MIN RELATIVOS\n");
    printf("4-EXTREMOS\n");
    printf("5-DOMINIO\n");
    printf("6-IMAGEM\n");
    printf("0-SAIR\n");
    opcao=input("Digite um numero:");
    if(opcao==0) then
        printf("\nVocê optou por sair do programa!");
end
end

So far I’ve been able to make the polynomial derivative work, I can extract the derivative from the typed expression. I wonder if there is any way to do the same with integral. Someone can help me?

I’ve been through all the documentation and found some integral commands like intg, etc. But these do not make integral with polynomials (you have to put the value of the variable). If anyone has any job suggestions or any commands that might help me, I’d appreciate it!

The expected input:

f(x)=2x²+4x

The expected to leave:

x³ + 2x²

  • The person who denied me could explain to me what is wrong with my question?

  • i do not understand this software and not so much of mathematics to help you, but I found this http://x-engineer.org/graduate-engineering/programming-languages/scilab/define-solve-polynomials-scilab/ and this https://x-engineering.org/graduate-engineering/programming--Languages/Scilab/Solve-Definite-integral-Scilab/,.

  • Thanks @Guilhermenascimento I’ll try to see!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.