wolfram-mathematicawolframalphawolfram-language

how to define different expression for each region(domain) in a function in wolfram alpha


I want to write the following function to wolframalpha

math equations

which means this function is defined by a different expression for x<0, 0<=x<=1 and x>1 by the expression above.

i found this answer which Brought me closer to the answer but not yet.
f(x,y) = cos(1/x) for x<0 , how to continue for the two different parts?

by the way, using Mathpix I could generate LATEX representation for this equation from the photo which wolfram should understand, but apparently not when splitting the function for different expression per domain...

how can I write this function to wolframAlpha?


Solution

  • Try

    plot Piecewise[{{cos(1/x),x<0},{sin(pi x),0<=x<=1},{2^-x,x>1}}] for -1<x<2
    

    WA page