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
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
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
3 answers
1k views

Integrating a piecewise function with symbolic pieces

Suppose I want to compute the antiderivative of this simple function: $$f(t)=\begin{cases} 1 & \text{if $0\le t\le t_1$,} \\ -1 & \text{if $t_1\le t\le t_2$}, \\ 0 & \text{otherwise,} \end{...
user avatar
6 votes
1 answer
941 views

Using Boole to integrate over region

I have a complex and long piecewise function to integrate, so I have written a Mathematica script that cuts the whole range of integration, evaluates the integrand in each region and then integrates ...
Nicola's user avatar
  • 572
6 votes
2 answers
658 views

Using units and piecewise functions in Integrate

For simple cases, Quantities appear to be handled well by Integrate: ...
SWB's user avatar
  • 625
5 votes
1 answer
1k views

Integrate over piecewise function defined using /;

f[x_] := x /; x<0 f[x_] := x^2 /; x>=0 Integrate[f[x],{x,-1,1}] The above does not work (Mathematica returns it unevaluated), but the below does. <...
user avatar
5 votes
3 answers
504 views

Creating a function with integral zeroes of the 0th, 1st, and 2nd derivatives

I would like to be able to randomly generate functions, each of which satisfies $f : [-10, 10] \rightarrow [-10, 10]$ All the zeroes, critical points, and inflection points have an integral $x$-...
Twiffy's user avatar
  • 369
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
5 votes
2 answers
630 views

Integration of a piecewise function with parameters

Here is a simple piece-wise and continuous function: f[t_,a_,b_]:=Piecewise[{{a t,t<1},{a,t<1+b},{a(2+b-t),t<2+b}}] When I integrate ...
Danvil's user avatar
  • 1,515
5 votes
1 answer
168 views

Reduce to Piecewise

There are some similar posts on SE, but none of them seems to exactly address my issue. I need to integrate a rather complicated function (over $x>1$) separately over two domains defined as ...
yarchik's user avatar
  • 19.2k
4 votes
2 answers
102 views

Plot and differentiate a piecewise vector function [closed]

Consider the map $f:\mathbb R^2\to \mathbb R$ defined as $$ f(x,y)=\begin{cases} \|(x,y)\|^2\sin(1/\|(x,y)\|) & (x,y)\neq0 \\ 0 & (x,y) =0\\ \end{cases}$$ I am trying to get a ...
laikaka's user avatar
  • 41
4 votes
3 answers
225 views

Getting error message when integrating a simple piecewise function

I reviewed the following questions: question 1 and question 2, but I need to the following integral of a piecewise function: ...
user45459's user avatar
  • 103
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
4 votes
1 answer
390 views

How to convert a Piecewise function in a HeavisideTheta function?

I want to convert a Piecewise function in a HeavisideTheta function in order to correctly evaluate its derivatives at the point of abrupt change and then integrate the result along the axis. How can I ...
Adam Reis's user avatar

15 30 50 per page
1
2 3 4 5