Skip to main content

All Questions

10 votes
2 answers
263 views

Problem with Integrate with Piecewise and PrincipalValue

Bug introduced in 8.0.4 or earlier and persisting through 11.3 In the course of developing an alternative solution for question 127301, With, ...
bbgodfrey's user avatar
  • 61.8k
6 votes
2 answers
3k views

Derivatives of piecewise functions of functions

Background Derivatives of piecewise functions in Mathematica are computed according to special rules. According the Piecewise documentation (see Possible Issues), ...
Virgil's user avatar
  • 3,447
6 votes
2 answers
1k views

Derivative of piecewise function

I tried to find $f'(0)$ of this function: $$f(x) = \begin{cases} x\cdot\sin(\frac{1}{x}) & \text{if $x\ne0$} \\ 0 & \text{if $x=0$} \end{cases}$$ This is what I tried in Mathematica: ...
GambitSquared's user avatar
3 votes
2 answers
690 views

Derivative of Continuous and Differentiable Piecewise function is indeterminate

I'm attempting to analytically stitch together two linear functions with two quadratic functions. The function I'm considering, then, is a piecewise function consisting of 4 parts. Below are the ...
psachdeva's user avatar
0 votes
1 answer
1k views

Finding the tangent to a piecewise function

I'm new to Mathematica and I am trying to calculate the expression of the tangent to the curve ...
NATALIA NAVEA's user avatar
5 votes
2 answers
317 views

Using Piecewise to create a periodic waveform

I want to create a piecewise function that repeats after t=T. ...
Syed's user avatar
  • 56k
4 votes
1 answer
395 views

Integration of a piecewise function

Define f[x_, i_] := Piecewise[{{1/n, 0 < x < (i - 1)/n}, {(i/n - x), (i - 1)/n < x < i/n} , {0, i/n < x}} ]; I would like to compute ...
Me-me's user avatar
  • 43
4 votes
3 answers
1k views

Most efficient way to integrate a linear piecewise function

I am having a lot of trouble integrating a simple function. Here's the context: I generate data from two distributions, and I want to calculate the overlap coefficient of representing those datasets ...
Aaron Bramson's user avatar
2 votes
2 answers
1k views

Piecewise Integration

I am trying to integrate a piecewise defined function twice. It represents the acceleration of a projectile. I am obtaining it's position as a function of time if it starts from rest at the ground, ...
Grant Moore's user avatar
2 votes
0 answers
540 views

Piecewise functions Integration with symbol

I want to integrate one piecewise functions as following, ...
Hailin's user avatar
  • 21
2 votes
2 answers
178 views

Integrate over a piecewise function [closed]

I want to calculate the indefinite Integral of $$f(x)=\begin{cases} 2x\cos(\frac{1}{x})& \text{ if } x\ne 0 \\ 0& \text{ if } x=0 \end{cases}.$$ I use the following code: ...
Elliot's user avatar
  • 149
1 vote
2 answers
414 views

Integration over a (non-parametric) curve defined by indicator function

I want to integrate the real function myFun defined on a 2D plane over the line locus, defined as the solution of a set of ...
Nicola's user avatar
  • 572
0 votes
0 answers
242 views

Implicit function: derivative of piecewise function that has a FindRoot in one of the pieces

I have a piecewise function that has as one piece the result of a numerical approximation, like in the example below: ...
Laura K's user avatar
  • 393
0 votes
1 answer
142 views

Strange behavior of derivative when using Abs[] [duplicate]

This code where I try to visualize Newton's Method on the function $f(x)=\sqrt{|x|}$ works fine when I define $f(x)$ piecewise. Then why doesn't it work when I define ...
GambitSquared's user avatar
0 votes
1 answer
70 views

Why do Integrate and DSolve/DSolveValue yield such complex expressions for Piecewise functions?

This code uses two different methods for integrating a very simple piecewise function but yields surprisingly complicated integrals: ...
Dan Sandberg's user avatar