I have this following function:

$$y\ =\ \sqrt{\left|x\right|^{2}}-\cos\left(3x\right)$$

which represents this:

enter image description here

And I need to find the intersection between an straight line created from two coordinates ($ab$ and $cd$) and this formula, something like this:

enter image description here

I only need the first intersection point coordinates ($ef$) (the closest).

On the internet I only find how to intersect circles with other straight lines. How do I do with a function?

I only have $ab$ and $cd$ coords and need to find $ef$.

  • 3
    $\begingroup$ In general if you have 2 functions $f(x), g(x)$, the points of intersection between them occur at the zeros of $f(x)-g(x)$. $\endgroup$ – 79037662 Sep 27 '19 at 17:40
  • $\begingroup$ @79037662 how can I represent $ab, cd$ into $g(x)$ ? $\endgroup$ – CypherPotato Sep 27 '19 at 17:43
  • $\begingroup$ it's a straight line so you can calculate the equation of a line from two points: mathsisfun.com/algebra/line-equation-point-slope.html $\endgroup$ – graeme Sep 27 '19 at 17:46
  • $\begingroup$ You're asking how to find the equation of a line given two points on it, this website can explain much better than I can: mathsisfun.com/algebra/line-equation-2points.html $\endgroup$ – 79037662 Sep 27 '19 at 17:47
  • 1
    $\begingroup$ You should set equal the equations of the curves (the straight line and the function) which obtains no analytical result in general and should be solved numerically. $\endgroup$ – Mostafa Ayaz Sep 27 '19 at 18:01

You may use point-slope form of line to find the equation of the line. $${{y-y_1}\over x-x_1} = m$$ $${{y-b}\over x-a} = {{b-d}\over {a-c}}$$ Your equation is $y=|x|-cos(3x)$

Substitute y in the equation of the line and solve for x. This will give you the value of e. With e, you can easily find the value of f.

| cite | improve this answer | |
  • $\begingroup$ Substitute $y$ with what? $\endgroup$ – CypherPotato Sep 27 '19 at 18:38
  • $\begingroup$ Substitute y with $|x|-cos(3x)$ in the line equation. $\endgroup$ – Sam Sep 27 '19 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.