Questions tagged [calculus]

Calculus is the study of change of one or more variables with respect to another variable. Calculus has two main operators: differentiation and integration. Differentiation can be used to study the change of one variable with respect to another. Integration can be used to find the area bounded by a function.

Calculus plays an important role in computer science, for example, in the comparison of the performance of various algorithms and the complexity of various problems. These are often expressed using big O notation, which relies on the idea of the limits of ratios of functions as a variable tends to infinity.

On the practical programming side, there are several fields that will require calculus to a greater or lesser extent:

  • Numerical analysis and computation.
  • Signal processing (Image, video, audio, etc).
  • Data analysis and prediction for business applications.
  • Modeling of dynamical systems.
  • Machine learning.
  • Physics engines for video games.
580 questions
-2
votes
1 answer

Basic example of how to do numerical integration in C++

I think most people know how to do numerical derivation in computer programming, (as limit --> 0; read: "as the limit approaches zero"). //example code for derivation of position over time to obtain velocity float currPosition, prevPosition,…
RhinoPak
  • 21
  • 6
-2
votes
1 answer

solution for integral of x/(x-6)dx

I was trying to solve this integral x/(x-6)dx and I used substitution. u = x-6 and x = u+6. In the end, I ended up with the answer x+6ln|x-6|-6+C, however, the answer is x+6ln|x-6|+C without the -6. Can someone help me understand why this is the…
-2
votes
2 answers

I am writing a program that accepts user input in order to differentiate a function

In order to find the maximums and minimums of a function, I am writing a program that accepts a polynomial imputed from the user and finds where the derivative = 0. from sympy import Symbol, Derivative from sympy import symbols, Eq, solve import…
-2
votes
1 answer

Calculating integral in MATLAB

How can I calculate the integral as shown in the screen shot, where j1 is a 1x3 matrix and j2 is also a 1x3 matrix, while g1 is a 300x3 matrix and also g2 is a 300x3 matrix. In the screen shot the '.' represents the dot product. Actually g1 and g2…
-2
votes
1 answer

Which mathematical function looks like this?

Symmetrical along the diagonal, but not approaching any asymptotes:
drgs
  • 375
  • 2
  • 8
-2
votes
1 answer

The relationship between derivatives and normal function

Let f’ be a differentiable function, and suppose that f(2x)=3f(x) for all x. Prove that f’(2x)=3/2f’(x).
-2
votes
1 answer

Could you give me some explain about how to calculate a partial derivative?

I'm reading an article about machine learning theory, there are has a step as below to calculate partial derivative: ∂(w5 * h1 + w6 * h2 + b3) / ∂h1 = w5 * f′(w5 * h1 + w6 * h2 + b3) As I understand the caclulation method of partial derivative, the…
sunjinbo
  • 2,137
  • 4
  • 22
  • 45
-2
votes
1 answer

Algorithms for implementing analytic calculus

I'm interested in writing a program in Python that can parse a mathematical expression and carry out operations on it in algebraic form. Most of these will be pretty easy, something like 2x+5x+xy. My program would take this and return the simplified…
muke
  • 306
  • 2
  • 11
-2
votes
1 answer

How to calculate and create an index to represent the values of other columns?

Please, could anyone help me implement the calculation outlined below. I'm using R in RStudio. df <- data.frame(x = c(1,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16,17,18,19,20), total_fatal_injuries =…
AnderOak
  • 11
  • 4
-2
votes
1 answer

Python: TypeError: can't multiply sequence by non-int of type 'float' when using float parameters

I'm writing a program to calculate left-hand, right-hand, and mid-point Riemann Sums (I misspelled it everywhere else). I decided to use python (I have some experience with it) to write the script and eventually build up a library of math tools that…
-2
votes
1 answer

calculating a vector between three vectors or more

am trying to get a vector of dimension >200 between two vectors by calculating, resVector = k*v1 + (1-k)*v2 save the new resultant vector and delete v1, v2 is there any way that i can add another third vector , so i can later…
-2
votes
3 answers

Calculate percentage for list of numbers

I have a list of integer values (positive, and negative). I need to calculate the percentage of each value. Is there any API in Java to achieve this? Example 1 - 10, 40, 60, -15, -25, 30, -10, -50, 120 -50 (lowest value) - 0% -25 - ? -15 - ? -10…
Shrihastha
  • 71
  • 1
  • 5
  • 16
-2
votes
3 answers

Should Maths Generally Be Used Over Other Functions/ Statements

In quite a few of my more recent programs, I've been using basic calculus to replace if statements such as in a for loop I've used: pos = cbltSz*(x-1) to get the position of a small cube relative to a large one rather than saying something like if(x…
Damon Jenkins
  • 352
  • 1
  • 3
  • 12
-2
votes
2 answers

Angularjs binding calculation

How can i calculate the sum of some scopes and rest the sum of other scopes with 30% discount?: {{(data.a * 30) + (data.b * 10) + data.c - [(data.d * 5)+(data.e * 0.75)] * 30 / 100}} I tried this and it's not working: {{data.dominio +…
-2
votes
3 answers

Integrals in java

I would like to ask whether is there a library or method in java that can take a string which contains the prescription of a function like "4x^2 + 3x" and return the integrated version of the string. When the input is "4x^2 + 3x" I want to get an…
padr
  • 385
  • 1
  • 4
  • 16
1 2 3
38
39