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
-1
votes
1 answer

Given that we have the radius of this line and the coordinate A, how can we calculate the coordinate C?

Given we have the radius of this circle and the coordinates of A, how can I calculate the coordinate of C? C is also at the furthest part away from the line, or in other words a line going form A to C would be rotated 90 degrees from the line …
-1
votes
2 answers

How to Find Area Under a Curve in Python

I am new to Python and have no way how to find the area under a curve given a function. If my function is for example 3x^2+2x+11, how can I even go about doing this? I would like to complete this using approximation.
-1
votes
2 answers

Why is there an "index out of range" here?

I'm currently working on a homework assignment, and the topic is to derive a Fibonacci sequence from a Pascal triangle. It sounds simple, but I came upon a lot of trouble when trying to use my method. I basically attempted to add all of the diagonal…
-1
votes
1 answer

Solving a cubic equation using pure python NO NUMPY or SCIPY

I was wondering if I could get help solving a generic cubic polynomial with coefficients a, b, c and d. I don't want to use scipy or numpy. For any complex-valued parameters, I want to find all 3 roots of the equation. This is what i attempted so…
-1
votes
1 answer

Calculating the tangent on a transition point of a black and white image

I would like to calculate the angle of the tangent on a given white to black transition point on an image that consists entirely of black and white pixels and displays simple shapes such as squares, circles or triangles. Zooming in on an image like…
Yes
  • 339
  • 3
  • 19
-1
votes
1 answer

How do I create Symbols in SymPy based on user input?

I am trying to create a python programme that takes a function from the user (in terms of x) and returns its derivative using SymPy. However, when I enter letters other than x, SymPy throws an error of undefined symbols. I want it to treat letters…
-1
votes
1 answer

What is derivative of FFT outputs with respect to time?

I am quite new to Digital Signal Processing. I am trying to implement an anti-cogging algorithm in my PMSM control algorithm. I follow this [documentation]. I collected velocity data according to the angle. And I translated velocity data to the…
-1
votes
5 answers

How do I execute Calculus operations in python?

How can I perform simple calculus operations on python such as Differentiation and Integration?
-1
votes
1 answer

Simple Polynomial Differentiator without external libraries

I'm trying to make a polynomial Differentiator without the use of external libraries like sympy and numpy, these are the test cases: "3 + 1x + 2x^2" ==> "1 + 4x" "1 + 2x + -3x^2 + 17x^17 + -1x^107" ==> "2 + -6x + 289x^16 + -107x^106" "17x + 1x^2"…
user13392187
-1
votes
3 answers

Find the area between two functions

I solve the following problem. There are two functions f(x) and g(x). Each of them is divided into parts. The f(x) function consists of 'n' parts, and g(x) consists of 'm' parts. Each part is represented as a Second-Degree Polynomial Function (ax^2…
Bahrom
  • 13
  • 3
-1
votes
1 answer

If f(w) = log(sigmoid(w^T*x)) calculate the gradient (d/dw) of f(w)

w is an (nx1) vector and X is an (nxn) matrix. Here's my work: However this site (http://www.matrixcalculus.org/) says that the derivative should be What am I doing wrong?
-1
votes
1 answer

Why is MAPLE not evaluating integrals and derivative inside my equations?

I'm using MAPLE 2019 and trying to insert different equations related with each other in order to evaluate one of them by insertions, integral and derivative calulations, till I get a compact short form where only independent variables appear. Here…
Marvin
  • 37
  • 5
-1
votes
1 answer

Optimization or Related Rates to solve this problem?

The problem: A company has $120 000 to spend on the development and promotion of a new product. The company estimates that if x is spent on the development and y is spent on promotion, then approximately (x^(1/2)y^(3/2))/(400000) items of new…
-1
votes
1 answer

How to calculate the gradient of a matrix

let f(x) = [2x^2, 3y^5] I know how to calculate the derivative of f(x), which will be [d/dx 2x^2, d/dx 3y^5]. Is there a similar process being done when calculating the gradient of f(x)? If not, then how do you calculate the gradient of f(x)?
-1
votes
1 answer

definite 4D integration in octave, with functions as limits

I need to do 4D integration in octave. My function is f(x,y,phi,theta) and some of the integration limits are function of the outer limits. 0 < theta < pi t1(x,y) < phi < t2(x,y) h1 < y < h2 w1 < x < w2 I wrote in octave like this…
Codelearner777
  • 313
  • 3
  • 15