Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8043103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:48:15+00:00 2026-06-05T04:48:15+00:00

I am implementing an algorithm for school and am having problems understanding how a

  • 0

I am implementing an algorithm for school and am having problems understanding how a definite integral is represented in programming. For example I know that the Summation equation can be implemented as the following example:
enter image description here

assuming y=f(x)

if(x==0){
    y=x+1;
}else{
    for(int i = 0; i < n; i++){
        y = y + (x - 1);
    }
}

How would I then represent a numerical integral, example:
enter image description here
The equations planted here may not make mathematical sense but my objective is to implement similar equations in c# for a school programming project that I have to do in which I have to implement an algorithm which contains integrals. I have been reading that there are numerical methods to solve definite integrals such as simpson rule; would I have to use such methods to implement the equation or can an integral be represented in programming such as a loop or something of that sort?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:48:17+00:00Added an answer on June 5, 2026 at 4:48 am

    It depends on what you are trying to do. If this was a specific implementation you could simply integrate the formula x-1 becomes (x^2)/2 - x and then return the max value minus the minimum value.

    Alternatively it can be implemented as an estimation choosing an appropriate step size for dx.

    decimal dx=0.1;
    
    if(x==0){  
        y=x+1;  // could just return y=1
    }else{  
        decimal tempY=0;
        for(decimal i = 3; i <= 20; i+=dx){  
            tempY += (i - 1);  
        }  
        // Either return tempY as decimal or
        y= Convert.ToInt32(tempY);
    }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems implementing an algorithm to read a foreign process' memory. Here
I'm implementing an algorithm that, in essence, is a series of matrix-matrix multiplications like
I am having trouble implementing a python algorithm which does the following: (This is
for a programming homework, I'm implementing Prim's algorithm, the format of the input file
I'm implementing a statistical algorithm that needs access to a large sample dataset for
As homework, I'm implementing Karatsuba's algorithm and benchmarking it against a primary-school-style O(n^2) multiplication
I'm currently implementing an algorithm that does allot of linear algebra on small matrices
I have been fighting all day in understanding Dijkstra's algorithm and implementing with no
For fun, I've been implementing the DES algorithm in java. (Well, it's not that
What algorithm is typically used when implementing a spell checker that is accompanied with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.